One thing you could do is to create assign dir for c drive d drive etc as /c
, /d etc
then this would work
unix_name = win_name.replace("\\","/").replace("c:","/c").replace("d:","/d")

On 5/8/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:

Anand wrote:

> Greetings,
>
> How do I convert programmatically the file names from WIN32 to UNIX
> format?
>
> A code snippet would be of great help.
> We are new to python! :)

unix_name = win_name.replace("\\", "/")

But this of course won't work for anything that starts with a drive letter
for example.

Diez
--
http://mail.python.org/mailman/listinfo/python-list




--
Regards--
Rishi Pathak
National PARAM Supercomputing Facility
Center for Development of Advanced Computing(C-DAC)
Pune University Campus,Ganesh Khind Road
Pune-Maharastra
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to