CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 08 Aug 2025 17:28:51 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071208094513
location: https://web.archive.org/web/20071208094513/https://wiki.python.org/moin/EnvironmentVariables
server-timing: captures_list;dur=0.804403, exclusion.robots;dur=0.021307, exclusion.robots.policy;dur=0.013966, esindex;dur=0.008655, cdx.remote;dur=65.080498, LoadShardBlock;dur=836.940667, PetaboxLoader3.resolve;dur=452.191721, PetaboxLoader3.datanode;dur=230.745035
x-app-server: wwwb-app201
x-ts: 302
x-tr: 929
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app201; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 08 Aug 2025 17:28:52 GMT
content-type: text/html;charset=utf-8
x-archive-orig-date: Sat, 08 Dec 2007 09:45:12 GMT
x-archive-orig-server: Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 08 Dec 2007 09:45:13 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 13 Sep 2006 07:30:48 GMT", ; rel="prev memento"; datetime="Sat, 30 Dec 2006 16:41:17 GMT", ; rel="memento"; datetime="Sat, 08 Dec 2007 09:45:13 GMT", ; rel="next memento"; datetime="Thu, 16 Sep 2010 05:07:11 GMT", ; rel="last memento"; datetime="Sun, 23 Jun 2024 21:00:08 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_1_20071208084132_crawl105-c/52_1_20071208094005_crawl107.arc.gz
server-timing: captures_list;dur=0.514818, exclusion.robots;dur=0.024750, exclusion.robots.policy;dur=0.015168, esindex;dur=0.013330, cdx.remote;dur=54.047008, LoadShardBlock;dur=552.850679, PetaboxLoader3.datanode;dur=157.064249, PetaboxLoader3.resolve;dur=768.391472, load_resource;dur=453.219901
x-app-server: wwwb-app201
x-ts: 200
x-tr: 1117
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
EnvironmentVariables - PythonInfo Wiki
EnvironmentVariables
Bash-like Global Substitution
1
2 globals().update(os.environ) # Import environment
3
4
5 def replace_w_global_value(mo):
6 key = mo.group(0)
7 without_dollar = key[1:]
8 return str(globals().get(without_dollar, key))
9
10
11 def subs(input):
12 """Perform Bash-like substitutions.
13
14 Any "$FOO" in a string will be replaced with the value of FOO.
15 If it's not defined, it stays as it was: "$FOO".
16 """
17 return re.sub('[$][A-Za-z_]+', replace_w_global_value, input)
Discussion
The only question I have is: Is there a way to make all assignments within the module, automatically call os.putenv?
So, intercept assignment with setattr or something, on the module.
I don't know how to get a handle to the current module, though.
-- LionKimbro 2005-12-16 20:37:07
EditText (last edited 2005-12-16 20:37:13 by LionKimbro)
DeleteCache (cached 2007-11-21 12:27:00)- Login
- Navigation
- Actions
- Your recent pages