[Tutor] getopts question

Greg Perry gregp at liveammo.com
Sat Mar 31 02:23:00 CEST 2007


Yeah I figured that.  I am trying to find a way to have the program detect if the user input is a file or directory, which is easy enough with os.path.  However, os.path makes no distinction between a regular file and a mask, eg filename.txt or *.txt.  I guess I'll have to have a second set of tests to see if the filename contains any wildcards..?

-----Original Message-----
From: Kent Johnson

>I'm not really sure what you are looking for here. If you use two options, you will have to test to see which option is set. You could use one option, then you will have to test to see if the value is a file or a directory.
>
>Kent





More information about the Tutor mailing list