Q. Write statements to open a binary file C:\Myfiles\Text1.txt in read and write mode by specifying the file path in two different formats.

Answer =


Format to Open :-

file = open ("C:\\Myfiles\\Text1.txt", 'rb')

Format to Write :-

file = open (r"C:\Myfiles\Text1.txt", 'wb')


1 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Plzz give other solution, of word replacing binary file to text file after to open a

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post