Dealing with files...

lost lost at soul.net
Sat Apr 26 00:39:14 CEST 2003


Hi guys!
I'm starting to deal with files, and need to know how to deal directly
with the filesystem. what I'm looking for, is similar to this pseudo code:

for each_file in "/var/path/to/files/":
	print each_file #show the NAME of the file 
	write the NAME of the file	into file_list.txt
print "done"

This would print the name of each file in /var/path/to/files (for example,
a list of html files), and then add the name of the file into
file_list.txt.

Any help on this would be very much appreciated! Thanks.




More information about the Python-list mailing list