Correspondingly, to the Faq Wiki I added:
/// http://pyfaq.infogami.com/installed-index
Q: Where is Python installed on my machine?
A: Binaries in bin/, source in lib/, doc somewhere else. Read the
module source when you find its doc incomplete.
On Linux, ...
On the Mac, straight from Apple:
/
Kindly offline the answer is:
(a) Python installation usually includes source, and thus
(b) UTSL:
$ pwd
C:\Python25\Lib\shlex.py
$ ...
$ pwd
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
$ grep -A 5 "def split" shlex.py
def split(s, comments=False):
lex = shlex(s, posix=True
> I see shlex.split gives me what I want ...
> shlex.shlex surprisingly gives me something else ...
> I can get closer ... by hacking ...
> .wordchars += ".+-"
Kindly offline I was told,
Try patching .whitespace_split = True instead. Compare:
shlex.split("//./PhysicalDrive9 //./Cdrom9 //./Tape9
> shlex.split gives me what I want ...
> every doc'ed instantiation of shlex.shlex ... gives me something else ...
Aye, the discrepancies are gross & legion - presumably astonishing only
newbies like me.
Here's a more dramatic example:
>>> import shlex
>>> shlex.split("//./PhysicalDrive9 //./Cdr
How can I instantiate shlex.shlex to behave like shlex.split does?
I see shlex.split gives me what I want:
import shlex
print shlex.split("1.2e+3")[0] # 1.2e+3
But every doc'ed instantiation of shlex.shlex surprisingly gives me
something else:
s1 = shlex.shlex("1.2e+3", None, False)
pr