|
From: Fernando P. <Fer...@co...> - 2005-06-22 17:46:18
|
Stephen Walton wrote:
> John Hunter wrote:
>
>
>>We might have to do something like
>>
>> os.popen('export TEXMFOUTPUT=/some/path; run some command')
>>
>>and then deal with platform and shell dependent differences in how to
>>set environment variables. Is there a better way? Me thinks it is
>>better to make this a FAQ and advise people working in non-writable
>>dirs to set this var themselves.
>>
>
> I agree with this last. On Unix, you could do
>
> os.popen('/bin/sh -c "export TEXMFOUTPUT=/some/path; run some command"')
>
> and be pretty sure it would work on all systems. But Windows would be a
> pain. I agree with the FAQ solution. This seems like a very rare
> problem to me, to be honest.
It may be simpler than that:
planck[~/test]> cat env.py
#!/usr/bin/env python
import os
print 'before'
os.system('env | grep TEXMFOUTPUT')
os.environ['TEXMFOUTPUT'] = '/some/path'
print 'after'
os.system('env | grep TEXMFOUTPUT')
planck[~/test]> ./env.py
before
after
TEXMFOUTPUT=/some/path
planck[~/test]>
Cheers,
f
|