RE: Setting os.sep to '/' in Windows

2001-07-24 Thread Mark Hammond
> Further to my previous question, I'd like to understand why python has > this seemingly strange behaviour. Use the source, Luke :) Python simply calls the MS "getcwd()" function, and returns the value directly. It does _not_ process the resulting string, swapping the "\\" for os.sep. As getc

Re: Setting os.sep to '/' in Windows

2001-07-24 Thread LUK ShunTim
Further to my previous question, I'd like to understand why python has this seemingly strange behaviour. ActivePython 2.1, build 211 (ActiveState) based on Python 2.1 (#15, Jun 18 2001, 21:42:28) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Re: Setting os.sep to '/' in Windows

2001-07-23 Thread LUK ShunTim
Wade Leftwich wrote: > > def runtex(): >os.system(path_to_tex.replace('\\','/')) > Not exactly what I want but I got the hint. Here's my little script which works. import os file = raw_input('Enter tex source with full path -->') newfile = file.replace('\\','/') tex_cmd = 'latex' + ' ' +

Re: Setting os.sep to '/' in Windows

2001-07-20 Thread Reggie Dugard
I believe you may want to use the 'posixpath' module. If you are using join, for example, you can do the following: >>> import posixpath >>> posixpath.join('/some/dir', 'file') '/some/dir/file' Reggie Dugard Merfin, LLC LUK ShunTim wrote: > Hi, > > Is there anyway to use '/' instead of '\