On Mar 22, 2:06 pm, Bradley Hintze <bradle...@aggiemail.usu.edu> wrote: > Hi, > > I just started with argparse. I want to simply check the extension of > the file that the user passes to the program. I get a ''file' object > has no attribute 'rfind'' error when I use > os.path.splitext(args.infile).
Addendum, some file objects have a name attribute (which I hadn't noticed until today): file.name If the file object was created using open(), the name of the file. Otherwise, some string that indicates the source of the file object, of the form <...>. This is a read-only attribute and may not be present on all file-like objects. http://docs.python.org/library/stdtypes.html#file-objects -- http://mail.python.org/mailman/listinfo/python-list