simple print is not working..

Carl J. Van Arsdall cvanarsdall at mvista.com
Wed May 24 15:49:38 EDT 2006


lahirister at gmail.com wrote:
> What is wrong with this script?
>
> #!/usr/bin/python
> fsfile = open('/tmp/fs_info.al', 'r')
> for line in fsfiles.readlines():
> print line
> fsfile.close()
>
>
>   
Did you cut and paste that code?  I see a couple typos

First, on the line

for line in fsfiles.readlines():

There's an extra s in fsfile

Secondly, the line:

print line

should have an indentation to denote that its the block of code that the 
for loop will execute on.

.c



-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list