Newbie question: files..

Sonny Parlin sparlin at openpro.org
Sun Oct 10 09:32:28 EDT 1999


"Jesse D. Sightler" <jsight at mindspring.com> writes:

> Or you could just do 
>   print open ('testfile.txt').read()
> 
> See, it's a one liner!  :-)  Similarly, you could simply replace the two
> lines in the for loop with the one statement:
>   print line[:-1]
> 

Ahh yes, I like the one liner!

> Python is frequently slightly slower than Perl.  However, you should
> note that at the very least the Python code is the same number of lines
> (or fewer using my version:), and doesn't have the silly unnamed
> variables or ludicrous use of file descriptors.  Python still rules. :)
>

That seems kind of odd (that Python would be more slower than Perl) they
are both scripting languages, and they are both coded in C underneath,
anymore on this?
 
Thanks for your help!

-Sonny
-- 
Sonny Parlin
sparlin at openpro.org
http://www.openpro.org
fingerprint = 45 FE 56 72 C2 04 CD 76  
		09 75 52 7A C6 7C 23 D2




More information about the Python-list mailing list