File Name Format

rishi pathak mailmaverick666 at gmail.com
Tue May 8 06:50:18 EDT 2007


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 <deets at nospam.web.de> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070508/2a352f3c/attachment.html>


More information about the Python-list mailing list