Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Tricky Python question :)
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Fri Sep 09, 2005 11:38 pm   Post subject: Tricky Python question :)

What's wrong with the following statement?

"In Python, methods are public by default."
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sat Sep 10, 2005 1:34 am   Post subject: (No subject)

What's the difference between:

code:
for line in file('foo').readlines():
   ...


And:

code:
for line in file('foo'):
   ...
Hikaru79




PostPosted: Sat Sep 10, 2005 1:41 am   Post subject: (No subject)

IRC wrote:
<wtd> In that same thread, there's another question up. Smile
<Hikaru79> Oh, I know that one. I think.
<wtd> Nifty
<Hikaru79> Is it that 'readlines()' reads the whole file in at once and then splits it into iteratable lines, while the second one reads the file line by line?
<wtd> Indeed.
<Hikaru79> w00t =D
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: