Convert between Windows style paths and POSIX style paths

N.K nirmalkannan at hotmail.com
Fri Jul 11 00:32:14 EDT 2003


os.path.join  is what you are looking for, i beleive

eg: appendedpath = os.path.join(dir1,filename)

Regards
Nirmal 

noah at noah.org (Noah) wrote in message news:<c9d82136.0307101244.4594e04d at posting.google.com>...
> Does anyone have a function to convert back and forth between
> NT style paths and POSIX style? It seems trivial, but 
> I want to make sure I don't overlook some obscure detail. 
> Is it a simple matter of translating / and \ characters?
> 
> FYI, I need a Python function that does what cygpath does so that
> I can run a script on either NT or UNIX or Cygwin.
> I want my config files use one style of path.
> 
> Yours,
> Noah




More information about the Python-list mailing list