godoy at ieee.org
Mon Dec 19 11:35:20 CET 2005
"Johhny" <exter_c at hotmail.com> writes:
> import string
Why's that here? You don't need that import...
> vsftpd=open('vsftpd.conf', 'r')
Open the file and associate its resulting *object* to the 'vsftpd' variable.
> print vsftpd
Print the object's __str__.
Read the full file into the string at the LHS (left side of the '='). In your
case, it reads the full file and discard its contents.
Read all other lines (none) into an array on the LHS.
Close the file.
> When I run the script I get the following:
> python reading_file.py
> <open file 'vsftpd.conf', mode 'r' at 0xb7d742a8>
> Does anyone have any advice on this issue at all.
What issue? You did nothing with what you read, just with the object itself.
Jorge Godoy <godoy at ieee.org>
More information about the Python-list