Haha. Works! Happy help you. Ask gurus about regexps. I know they have an opinion about its speed and optimization. So they can try to criticise. But the problem is solved. It's good.
On Sun, 31 Jul 2011 09:18:33 -0700 "Richard D. Moores" <rdmoo...@gmail.com> wrote > > Nice! > > I went with > > > import os.path > import re > > def convertPath(path): > separator = os.path.normpath("/") > if separator != "/": > path = re.sub(re.escape(separator), "/", path) > > return path > > > > path=r'C:\Users\Dick\Desktop\Documents\Notes\College Notes.rtf' > > print(convertPath(path)) > > """ > Output > C:/Users/Dick/Desktop/Documents/Notes/College Notes.rtf > """ > Dick ____________________________________________________________ South Africas premier free email service - www.webmail.co.za For super low premiums, click here http://www.dialdirect.co.za/?vdn=15828 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor