Computer Science
Write statements to open a binary file C:\Myfiles\Text1.txt in read and write mode by specifying file path in two different formats.
Python File Handling
10 Likes
Answer
The two different formats of specifying file path for opening the file C:\Myfiles\Text1.txt in read and write mode are:
file1 = open("C:\\Myfiles\\Text1.txt", "rb+")file2 = open(r"C:\Myfiles\Text1.txt", "rb+")
Answered By
7 Likes
Related Questions
What is the significance of a file-object ?
How is file open() function different from close() function?
Which of the following Python modules is imported to store and retrieve objects using the process of serialization and deserialization ?
- csv
- binary
- math
- pickle
Which of the following function is used with the csv module in Python to read the contents of a csv file into an object ?
- readrow()
- readrows()
- reader()
- load()