is a file open ?
John Machin
sjmachin at lexicon.net
Wed Jul 20 06:57:06 EDT 2005
More information about the Python-list mailing list
Wed Jul 20 06:57:06 EDT 2005
- Previous message (by thread): is a file open ?
- Next message (by thread): is a file open ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
luis wrote: > for root, dirs, files in os.walk(path): > for file in files: > # ¿ is opened ? > ¡ rtfm ! "files" is a list of fileNAMEs -- i.e. strings. ¿ How could you possibly imagine that your sample code would open a file? What a design-nonsense that would be: instant complaints from folk who wanted to do some further selection before opening (if they ever wanted to open the files at all). ¿ Did you contemplate *trying* this code to see what happened ? ¡ Don't use "file" as a name; it shadows the built-in file function !
- Previous message (by thread): is a file open ?
- Next message (by thread): is a file open ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list