Re: checking for when a file or folder exists, typing

2005-06-12 Thread Bryan Rasmussen
>Hi Bryan, >Here's a potential idea. Try converting the variable to a string by >using the following syntax: > thePath = str(thePathArg) Actually it was a stupid thing, what happened was I was looping through the commandline to build a file path in cases where there was more than one comman

Re: checking for when a file or folder exists, typing problems?

2005-06-12 Thread Scott David Daniels
Bryan Rasmussen wrote: > ... at one point in my program I check if a file exists using > if exists("c:\projects"): You should not be using a backslash in non-raw-string source to mean anything but "escape the next character." The above should either be written as: if exists(r"c:\projects

Re: checking for when a file or folder exists, typing problems?

2005-06-12 Thread Brian
Hi Bryan, Here's a potential idea. Try converting the variable to a string by using the following syntax: thePath = str(thePathArg) This will convert the current variable type to a string, which follows the data type syntax that you have specified at the beginning of your message. Hope

checking for when a file or folder exists, typing problems?

2005-06-12 Thread Bryan Rasmussen
Hi I have a little program that is importing from os.path import exists, join, isdir, normpath, isfile at one point in my program I check if a file exists using if exists("c:\projects"): and that works fine. If I change it to be if exists(thepath): where thepath is a commandline argument it does