in reply to [OT++] Seeking Win32 Python Wisdom
"Alternatively, is there a file somewhere inside my existing python-2.7 distro that I could hack such that those backslashes are replaced by forward slashes ?"
>>> import site >>> site.getsitepackages() ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-pa +ckages']
locate sysconfig.py /usr/lib/python2.7/sysconfig.py /usr/lib/python2.7/sysconfig.pyc /usr/lib/python2.7/dist-packages/distlib/_backport/sysconfig.py /usr/lib/python2.7/dist-packages/distlib/_backport/sysconfig.pyc /usr/lib/python2.7/distutils/sysconfig.py /usr/lib/python2.7/distutils/sysconfig.pyc /usr/lib/python3.4/sysconfig.py /usr/lib/python3.4/distutils/sysconfig.py
That's on Linux, but the premise is the same for Windows. Briefly looking at the _getuserbase() code within the /usr/lib/python2.7/sysconfig.py file, the result may be coming from somewhere in the os.path method (os.py file), and I suspect that hacking it to do what you want will take quite some effort to make it consistent, while not breaking other stuff.
As mentioned already by thanos1983, modifying the result as it is returned to you, or overriding the method may be your best and/or safest bet.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [OT++] Seeking Win32 Python Wisdom
by syphilis (Archbishop) on Mar 16, 2017 at 23:51 UTC | |
by stevieb (Canon) on Mar 17, 2017 at 13:15 UTC | |
by syphilis (Archbishop) on Mar 18, 2017 at 05:52 UTC | |
|
Re^2: [OT++] Seeking Win32 Python Wisdom - duplicate (or close to) - please reap
by syphilis (Archbishop) on Mar 16, 2017 at 23:51 UTC |