argparse and filetypes

2011-03-22 Thread Bradley Hintze
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). Here is my code. import argparse, sys, os des = 'Get restraint definitions

Re: argparse and filetypes

2011-03-22 Thread Alex Willmer
On Mar 22, 2:06 pm, Bradley Hintze bradle...@aggiemail.usu.edu wrote: 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).  Here is my

Re: argparse and filetypes

2011-03-22 Thread Alex Willmer
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).

Re: argparse and filetypes

2011-03-22 Thread Robert Kern
On 3/22/11 9:06 AM, Bradley Hintze 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). Here is my code. import argparse,