0

How do I open a text file that I made with Notepad?

I wrote 5 lines on notepad and named it Line_Practice_Python, then saved it as a text file. This is what I did: open ("Line_Practice_Python.txt") then, it said" FileNotFoundError, so how do I fix it so that it can open that file?

20th Nov 2016, 12:21 AM
Tejhan
Tejhan - avatar
2 Respuestas
+ 2
In notepad, you should be able to reopen the file automatically and then "Save As..." (Save won't present the location dialog once the file's created). You have to give Python this path, or put the file in the same place as your script's working directory. If you can't find it, Win+F on Windows is Find, I think.
20th Nov 2016, 7:30 AM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Is your text file in same directory as your Python file? Also specify read or write after filename.
20th Nov 2016, 5:14 AM
Akash Vibhute
Akash Vibhute - avatar