homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients ZhuangZi, bethard, r.david.murray
Date 2012年09月07日.16:23:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347035034.57.0.292615354316.issue15874@psf.upfronthosting.co.za>
In-reply-to
Content
I had forgotten all about os.path.expandvars. Note, however, that that function is very naive:
 >>> os.path.expandvars("'$HOME'")
 "'/home/rdmurray'"
That is, it is doing unconditional substitution, not parsing shell syntax. It should work well for simple cases, though.
It might be worth throwing up a trial balloon on python-ideas for adding something to shlex that would do a "better" job of environment variable substitution for the version of shell syntax that shlex supports, which would therefore become a sort of platform-independent syntax for doing this.
History
Date User Action Args
2012年09月07日 16:23:54r.david.murraysetrecipients: + r.david.murray, bethard, ZhuangZi
2012年09月07日 16:23:54r.david.murraysetmessageid: <1347035034.57.0.292615354316.issue15874@psf.upfronthosting.co.za>
2012年09月07日 16:23:54r.david.murraylinkissue15874 messages
2012年09月07日 16:23:53r.david.murraycreate

AltStyle によって変換されたページ (->オリジナル) /