Important Notice:

File Opening Modes in Python

File Opening Modes in Python

3 views 1 min read

File Opening Modes in Python :-

Python में File Opening Modes यह निर्धारित करते हैं कि किसी file को किस प्रकार open किया जाएगा। जैसे file से data पढ़ना, नया data लिखना, पुराने data के अंत में नया data जोड़ना या Binary Data को process करना।

File opening mode को open() function में दिया जाता है।

English:

File opening modes in Python determine how a file will be opened, such as reading data, writing new data, appending data, or processing binary data.

The mode is specified in the open() function.

Syntax- file = open("filename", "mode")

File Opening Modes की List -

r  - Read Mode
     File पढ़ना

w  - Write Mode
     File में लिखना

a  - Append Mode
     File के अंत में data जोड़ना

x  - Create Mode
     नई File बनाना

r+ - Read and Write Mode
     File पढ़ना और लिखना

w+ - Write and Read Mode
     File में लिखना और पढ़ना

a+ - Append and Read Mode
     File के अंत में data जोड़ना और पढ़ना

b  - Binary Mode
     Binary Data को Process करना

Related Notes