Python Programming Tutorial - 41 - Working with Files
Top Comments
All Comments (104)
-
Why wouldn't I just go to my text file and edit it? Where is the benefit in this? I am just wondering by the way, not hating loving the tutorials!
-
@ChrisFord599 that is sooo ridiculously useful thank you so much
-
I love reviewing all tuts <333
-
man, I am going through google's python classes online, and you make so much more sense. Great job! I was having difficulty with opening files and you made it a cinch. I am now going to go through your python tutorials. Keep up the good work.
-
@Frycek216 Thanks, that did the trick.
-
@TheIronClimber I think it's readlines() in python 2.7
-
Is the 'read' function different for python 2.7?
-
@QuilavaKing use fob.seek(0) this resets the stream position back to byte 0. To read and write if you use fob=open('C:/test/a.txt','a+') you open your file for appending to the end and reading.
"As you can see, that empty file now has, 'hey now brown cow,' with brown misspelt; just like we did it."
3:03
themooseatestuff 1 year ago 12
thenewboston:
try using Alt+P
in IDLE, pressing Alt+P brings up your most recent typed line, multiple presses of Alt+P scrolls through your lines...
I just noticed you typing your file directory twice, you don't need to do that... :) You would just need to edit your mode after using Alt+P
By the way nice vids. Entertaining, even though I know all this stuff. :)
ChrisFord599 10 months ago 7