On 24-May-06, at 3:41 PM, [EMAIL PROTECTED] 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() > > > #./get_fs_info.py > File "./get_fs_info.py", line 4 > print line > ^ > SyntaxError: invalid syntax > > > Any ideas? > > Thanks > AL
Well first, you have to indent properly :) Assuming you did that and the copy & paste just removed it, you're also creating a variable called fsfile, then trying to call the readlines() method on an object called fsfiles... that'll cause a problem. Cheers, -- Paul Osman http://www.eval.ca -- http://mail.python.org/mailman/listinfo/python-list