python os.path.exists failure

Aahz aahz at pythoncraft.com
Wed Nov 4 22:57:06 CET 2009


In article <9aaf6a31-a34e-454b-a8f0-e206ad9b7040 at t2g2000yqn.googlegroups.com>,
koranthala  <koranthala at gmail.com> wrote:
>
>path = r'C:/"Program Files"/testfolder/2.3/test.txt'
>if os.path.lexists(path):
>    print 'Path Exists'
>else:
>    print 'No file found in path - %s' %path
>print Popen(path, stdout=PIPE, shell=True).stdout.read()

Avoiding shell=True is a Good Idea
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

[on old computer technologies and programmers]  "Fancy tail fins on a
brand new '59 Cadillac didn't mean throwing out a whole generation of
mechanics who started with model As."  --Andrew Dalke



More information about the Python-list mailing list