Added: 2 years ago
From: thenewboston
Views: 42,346
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (47)

Sign In or Sign Up now to post a comment!
  • I couldn't see the text file that he added the 4 lines to, but whatever.

  • hey typed the backslash exactly 3 times throughout the entire series

  • pure and simple, you are the best bucky!

  • If anyone here is a Python Coding Legend please message me :)

  • @m33taphor that's me

    

  • @m33taphor Which python coding legend would watch beginner tutorials? Yeah, all n00bs here! Including me! :P

  • The best python tutorial I have ever seen, make learning happy and easy.Hope this series will keep going and introduce more advanced features.

    Keep Moving , buddy. We all love it !!!!

  • lol he always hits that forward slash \ key

  • Hello, I'm very new to python and programming in general. Basically what I need to do is take a csv, look at the first row and if it says something (say 'D'), then read the contents of the colum. Then I want to copy the rows that contain a certain value (say all rows that have '0' in column 'D'). From this I want to construct a new csv that has all of the rows with the same value for column D. A,B,C,D 1,X,3,0 2,Y,2,1 3,Z,1,0 So from this I want: A,B,C,D 1,X,3,0 3,Z,1,0 ...etc
  • @AJALA1999 You might want to join the Python Tutor Mailing List to get help like this. They will answer just about any Python question (as long as you've tried to figure out the answer yourself). Very nice people. And of course anyone on the list can help you, but they have mods who always answer your questions too.

  • do yo have a tutorial to open edit and close CSV file with python?

  • hi newboston your tutorials are really good but i would like to know if you have a tutorial to open edit and close CSV files using python that would be great!!

  • >>> fob.readlines()

    ['lineone\n', 'linetwo\n', 'linethree']

    >>> fob.read(25)

    ''

    >>> fob.read(5)

    ''

    >>> fob.readlines()

    []

    >>>

    great job Python, suddenly my lines disappear, but not in the .txt folder

  • If you want to let the user input text for the file,

    use this:

    text=raw_input("Write text for file here: ") fob.write(text.replace("\\n", "\n"))

  • Correct me if im wrong but is is possible to use fob to open any file or another program such as the command prompt like is you put fob('c:/cmd.bat')

  • @Gmez1407 haha i doubt it but very good question tell me if you figure it out.

  • Instead of readline, which reads line for line, readlines reads line by line, each line, into a list. So instead of just returning the lines, line, line, line at a time. It takes all the lines and returns them line by line but it does it as a list. Or something along that line. ROFL

  • breaky u lie :( u always say this "\" doesnt mean anything but i dont believe u :)

  • Let's go head!

    :)

  • What about changing some positions on each line. Like position 6-10 to ABCDE.

    Would be usefull.

    Thanks for great tutorials.

  • can you read dll or exe files without getting difficult code like x00 x01 ect. ????

  • Why is the first line not shown up in fob.readlines?

  • @blower05 He had already read the first line above.

  • @TheBoyyini If you've been watching for about 2 hours, you shouldn't be this far should you...?

  • Yet another great tutorial. Keep up the great work!

  • I'm watching like 5 of these at a time and writing almost everything he does in a notebook. Then I try to figure out what kind of simple prog would use the stuff I just learned. So far I've done Mad Libs, simple bill calculators, and then "deluxe" versions of the same progs and stuff like that. The notes really help, but the incorporating of info into something I wrote myself REALLY helps. So if you're having trouble, try something similar. I'm having a LOT of fun. These vids are SUPERB.

  • thanks a lot~~

  • For the newbies:

    The original file had 3 lines:

    whats ur name

    my anmes bucky

    tell ur mom the same

    After using the write command, the original contents of the file are lost and the new file only has four lines (not seven):

    this is a new line

    this is line 2

    this is third line

    this is the last ANd final line

  • The original file had 4 lines

    hey now borwn cow

    whats ur name

    my anmes bucky

    tell ur mom the same

    just to be precise...

  • 2:30

  • pilitsos2, yes, you are absolutely right, the original file had 4 lines. Thanks for the correction!

  • this is hard

  • Of course it is, go to tutorial 1

  • lol i have watched all of them. anway i dont use this anymore.

  • Huh? Wait, so you're saying you've quit programming or you moved to a more advanced language.

  • yah

  • @Scottk95

    it's not hard, but it takes focus/commitment-

    that's what makes it good :) if it was easy and everyone knew it, then to me, it loses it's value.

  • LOL tell ur mom the same time

  • yep, thanks

  • I am just going to have to believe you on the lines :). Couldn't see crap

  • Thx for all the vids!

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