[Python-Dev] using pyhon from the MSYS shell
lode leroy
lode_leroy at hotmail.com
Tue Jun 28 11:39:03 CEST 2005
I was trying to compile a python plugin (for gimp) using the MSYS shell and
the MINGW compiler.
I now have put this in 'sitecustomize'
$ cat /c/Python24/lib/site-packages/sitecustomize.py
import sys
import os
import re
if os.environ.get("MSYSTEM") == "MINGW32":
os.sep='/'
os.pathsep='/'
sys.prefix = re.sub('\\\\','/',sys.prefix)
sys.exec_prefix = re.sub('\\\\','/',sys.exec_prefix)
It would probably be better to have python detect that it's running from
inside the msys shell,
and output '/'es instead of '\'es.
maybe someone could extend os.path to do this in the standard distribution:
implement an msyspath.py, which calls ntpath for each function, and does a
replace at the end of the evaluation. Unfortunately, I'm just starting to
look into python, so I do not know what the cleanest implementation of this
would be...
More information about the Python-Dev
mailing list