Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Python Programming Tutorial - 41 - Working with Files

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
45,349
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 28, 2009

Part 42 - http://www.youtube.com/watch?v=gNVlxvSEFO4

How to work with files in python

  • likes, 2 dislikes

Link to this comment:

Share to:

Top Comments

  • "As you can see, that empty file now has, 'hey now brown cow,' with brown misspelt; just like we did it."

    3:03

  • 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. :)

see all

All Comments (104)

Sign In or Sign Up now to post a comment!
  • 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.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more