On 24Jun2017 21:31, Gene Heskett wrote:
On Saturday 24 June 2017 21:03:18 Steve D'Aprano wrote:
On Sun, 25 Jun 2017 08:39 am, Gene Heskett wrote:
> On Saturday 24 June 2017 16:49:25 Smith wrote:
>> Hello to all,
>> I wanted to ask you how I could delete a line of an env
On Saturday 24 June 2017 21:03:18 Steve D'Aprano wrote:
> On Sun, 25 Jun 2017 08:39 am, Gene Heskett wrote:
> > On Saturday 24 June 2017 16:49:25 Smith wrote:
> >> Hello to all,
> >> I wanted to ask you how I could delete a line of an environment
> >> va
On Sun, 25 Jun 2017 08:39 am, Gene Heskett wrote:
> On Saturday 24 June 2017 16:49:25 Smith wrote:
>
>> Hello to all,
>> I wanted to ask you how I could delete a line of an environment
>> variable (PATH)
[...]
> export PATH=
>
> but be prepared to type the full
On Saturday 24 June 2017 16:49:25 Smith wrote:
> Hello to all,
> I wanted to ask you how I could delete a line of an environment
> variable (PATH)
>
> ~/Scaricati/pycharm-2017.1.4/bin$ echo $PATH | sed s/:/'\n'/g
> /usr/local/sbin
> /usr/local/bin
> /usr/sbi
On 2017-06-24 15:49, Smith wrote:
Hello to all,
I wanted to ask you how I could delete a line of an environment variable
(PATH)
~/Scaricati/pycharm-2017.1.4/bin$ echo $PATH | sed s/:/'\n'/g
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
Hello to all,
I wanted to ask you how I could delete a line of an environment variable
(PATH)
~/Scaricati/pycharm-2017.1.4/bin$ echo $PATH | sed s/:/'\n'/g
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/snap/bin
/path/to/my/program ---
loial writes:
> I need to modify the LIBPATH environment variable when running a
> process via subprocess, but otherwise retain the existing environment.
>
> Whats the best way to do that?
Pass env=dict(os.environ, LIBPATH=value) parameter:
import os
impor
In a message of Wed, 23 Sep 2015 02:51:53 -0700, loial writes:
>I need to modify the LIBPATH environment variable when running a process via
>subprocess, but otherwise retain the existing environment.
>
>Whats the best way to do that?
import subprocess, os
my_env = os.environ # if
On 23Sep2015 02:51, loial wrote:
I need to modify the LIBPATH environment variable when running a process via
subprocess, but otherwise retain the existing environment.
Whats the best way to do that?
Make a copy of os.environ, modify the copy, pass it via the env=parameter of
I need to modify the LIBPATH environment variable when running a process via
subprocess, but otherwise retain the existing environment.
Whats the best way to do that?
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-02-21 22:48, Hobie Audet wrote:
How many other environment variables are doubled? All of them?
The only other environment variable I have tried is REMOTE_ADDR, and
that does not appear to be doubled.
Does the problem exist when
the Python script is run directly, outside
Abyss, or
How many other environment variables are doubled? All of them?
The only other environment variable I have tried is REMOTE_ADDR, and
that does not appear to be doubled.
Does the problem exist when the Python script is run directly, outside
Abyss, or in IDLE, for example?
The problem is
In Hobie Audet
writes:
> 7. What it echoes back is "userxyzuserxyz". In other words, the
> REMOTE_USER value is repeated.
What username is recorded in the access_log file?
> executed correctly. By why the "REMOTE_USER" value is doubled is
> beyond my understanding. Is this a bug in the
On 2014-02-20 14:53, Hobie Audet wrote:
I'm running the Abyss Web Server X1 (v 2.9.0.1) on a Windows XP Home
(SP3) system and am using Python 3.3 for a scripting language. I'm
having a problem getting the environment variable "REMOTE_USER". Here's
the situation:
I'm running the Abyss Web Server X1 (v 2.9.0.1) on a Windows XP Home
(SP3) system and am using Python 3.3 for a scripting language. I'm
having a problem getting the environment variable
"REMOTE_USER". Here's the situation:
1. I have created a user under Abyss. Th
On Sun, Jun 10, 2012 at 3:51 PM, Ned Deily wrote:
>>
>> Thank you Ned,
>> but I can't find environment variable name on that page which is
>> equivarent to '--install-scripts' or other options.
>
> Sorry, I wasn't clear. Using the Distutils conf
gt;> For example:
> >>
> >> $ python setup.py install --prefix=$PWD/local --install-scripts=$PWD/bin
> >>
> >> Question: is it possible to specify these options by environment variable?
> >> I want to specify --prefix or --install-scripts option
thon setup.py install --prefix=$PWD/local --install-scripts=$PWD/bin
>>
>> Question: is it possible to specify these options by environment variable?
>> I want to specify --prefix or --install-scripts options, but it is
>> too troublesome for me to specify them in command l
possible to specify these options by environment variable?
> I want to specify --prefix or --install-scripts options, but it is
> too troublesome for me to specify them in command line every time.
There are some environment variable options for Distutils-based (i.e.
with setup.py) ins
Hi,
"setup.py install" command supports options such as --prefix,
--install-scripts, and so on.
For example:
$ python setup.py install --prefix=$PWD/local --install-scripts=$PWD/bin
Question: is it possible to specify these options by environment variable?
I want to specify -
On Tue, 03 Jan 2012 15:45:20 +1000, Ashton Fagg wrote:
> I'm working with an embedded machine, which is using a Python script to
> oversee the acquisition of some data. The supervisor script, which is
> run by crontab every 5 minutes, relies on an environment variable to be
>
Hi list.
A bit new to Python so please forgive my potential ignorance.
I'm working with an embedded machine, which is using a Python script to
oversee the acquisition of some data. The supervisor script, which is
run by crontab every 5 minutes, relies on an environment variable to be
How about doing something like
host.name=%HOSTNAME%
Then when you parse in the value %HOSTNAME% from your configParser module you
do a pattern substitution of %HOSTNAME% with os.environ['HOSTNAME'].
Sent from my iPhone 4.
On Oct 14, 2010, at 7:57 PM, pikespeak wrote:
> Hi,
> I am using Conf
Hi,
I am using ConfigParser module and would like to know if it has the
feature to autoexpand environment variables.
For example currently, I have the below section in config where
hostname is hardcoded.
I would like it to be replaced with the values from the env variable
os.envion['HOSTNAME'] so t
.org
Sent: Fri, June 11, 2010 2:05:15 PM
Subject: Re: passing environment variable path to open command
Am 11.06.2010 10:39, schrieb Mahmood Naderan:
> Hi,
> I am new to python so my question may be very basic.
> Suppose I have a file (sc_1.sh) which the path to that file is in system path:
>
Am 11.06.2010 10:39, schrieb Mahmood Naderan:
> Hi,
> I am new to python so my question may be very basic.
> Suppose I have a file (sc_1.sh) which the path to that file is in system path:
> SOMETHING=/home/mahmood/scripts
>
> Now I want to open that file with respect to the en
Mahmood Naderan wrote:
Hi,
I am new to python so my question may be very basic.
Suppose I have a file (sc_1.sh) which the path to that file is in
system path:
SOMETHING=/home/mahmood/scripts
Now I want to open that file with respect to the environment variable:
import os
env
Hi,
I am new to python so my question may be very basic.
Suppose I have a file (sc_1.sh) which the path to that file is in system path:
SOMETHING=/home/mahmood/scripts
Now I want to open that file with respect to the environment variable:
import os
env = os.getenv("SOMETHING")
> Code A:
>
> p = subprocess.Popen( ['python', '-V'], env={ 'PYTHONPATH': 'C:/
> Documents and Settings/David Gould/workspace/DgTools/Common/Trunk/
> Source' } )
> print p.communicate()[0]
> print p.returncode
>
> Output:
>
> None
> -1072365564
My *guess* is that since PATH is not in the environme
Quoth MRAB :
> davidgo...@davidgould.com wrote:
> > I'm attempting to run subprocess and passing in an environment
> > variable. When I do this the child process fails with an error. When I
> > don't pass an environement variable it runs fine.
> >
>
davidgo...@davidgould.com wrote:
> I'm attempting to run subprocess and passing in an environment
> variable. When I do this the child process fails with an error. When I
> don't pass an environement variable it runs fine.
>
> BTW Running this code under Windows XP wit
I'm attempting to run subprocess and passing in an environment
variable. When I do this the child process fails with an error. When I
don't pass an environement variable it runs fine.
BTW Running this code under Windows XP with Python 2.6.1
Code A:
p = subprocess.Popen( ['pyth
On Thu, Oct 2, 2008 at 11:18 AM, bill <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Can Python set a DOS environment variable?
>
> TIA,
>
> Bill
I'd look at http://www.python.org/doc/2.5.2/lib/os-procinfo.html . It
looks like putenv should do what you want. It might
Hi all,
Can Python set a DOS environment variable?
TIA,
Bill
--
http://mail.python.org/mailman/listinfo/python-list
single working-env per user. The
> > latter could still be achieved by setting the appropriate environment
> > variable in the user profile. Do you think it would be possible to
> > accommodate for the above in your PEP?
>
> Isn't PYTHONUSERBASE sufficient for your need
Small variation on the above patch, using 2 environment variables:
PYTHONSITEDIR allows for local site-packages (that override system
site packages), and PYTHONNOSYSSITES skips system site-packages for
"clean-room" operation (similar to virtual-python.py --no-site-
packages).
--- /usr/lib/python2
ago wrote:
The only thing I would add is that in my experience I often use
different working-envs for different projects, so I'd prefer to have a
more generic solution as opposed to a single working-env per user. The
latter could still be achieved by setting the appropriate environment
var
xperience I often use
different working-envs for different projects, so I'd prefer to have a
more generic solution as opposed to a single working-env per user. The
latter could still be achieved by setting the appropriate environment
variable in the user profile. Do you think it would be possible to
ago wrote:
Wouldn't it be possible to support a PYTHONSITEDIR environment
variable in site.py for this purpose? I have attached a possible
patch. In what follows, if PYTHONSITEDIR is defined, that dir is used
as the only source of site-packages, extra paths can easily be added
by creating a
get close, but not quite there, and the above scripts seem
a bit over the top.
Wouldn't it be possible to support a PYTHONSITEDIR environment
variable in site.py for this purpose? I have attached a possible
patch. In what follows, if PYTHONSITEDIR is defined, that dir is used
as the only sourc
On Aug 18, 11:17 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
>
> The easiest solution (in my opinion) is to write a bash script to
> execute your Python script, and use that bash script to add those
> environment variables.
Agreed. Wrap it in a shell script, easier to read and grow than a
on
On Aug 19, 2:37 am, "Stephen Cattaneo" <[EMAIL PROTECTED]>
wrote:
> - What did you run in the cronjob to get back all those variables?
>
> set; echo "-"; echo "import os; print
> os.environ" | python
>
> Cheers,
>
> S
As I should have noted from $BASH_EXECUTION_STRING. I'd be hal
PM
- To: python-list@python.org
- Subject: Re: Python does not get environment variable when using cron.
-
- On Aug 18, 11:15 am, "Stephen Cattaneo"
- <[EMAIL PROTECTED]> wrote:
- > Hello all,
- >
- > I am attempting to execute an automated test (written in Python) via
- > cron
Here's a more "English" version of what people are trying to explain:
When you log into a Unix session, certain files in your home directory
are read and add environment variables to your session. When you run a
cron job, it does not do this. It still runs as "you" as far as
permissions go, but it
9:39 PM
To: python-list@python.org
Subject: Re: Python does not get environment variable when using cron.
I'm not sure about the environment variable, but os.uname() should
give you what you need otherwise.
--
http://mail.python.org/mailman/listinfo/python-list
The information contain
Le Monday 18 August 2008 07:11:59 Cameron Simpson, vous avez écrit :
> You're probably confused by the fact that cron does not invoke "login"
> shells (with their associated initialisation from /etc/profile and
> $HOME/.profile).
This can be solved by invoking /bin/bash -l -c ..., the -l option fo
On 17Aug2008 21:25, John Nagle <[EMAIL PROTECTED]> wrote:
> Stephen Cattaneo wrote:
>> I am attempting to execute an automated test (written in Python) via
>> cron. I have to check the HOSTNAME variable as part of the test, oddly
>> under cron the HOSTNAME environ
Stephen Cattaneo wrote:
Hello all,
I am attempting to execute an automated test (written in Python) via
cron. I have to check the HOSTNAME variable as part of the test, oddly
under cron the HOSTNAME environment variable is not in the os.environ
dictionary. I know that cron runs in a subshell
On Aug 18, 11:15 am, "Stephen Cattaneo"
<[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I am attempting to execute an automated test (written in Python) via
> cron. I have to check the HOSTNAME variable as part of the test, oddly
> under cron the HOSTNAME environment va
On Aug 18, 11:38 am, "Eric Wertman" <[EMAIL PROTECTED]> wrote:
> I'm not sure about the environment variable, but os.uname() should
> give you what you need otherwise.
As documented, it should but may not ... consider using
socket.gethost*
--
http://mail.python.org/mailman/listinfo/python-list
I'm not sure about the environment variable, but os.uname() should
give you what you need otherwise.
--
http://mail.python.org/mailman/listinfo/python-list
Hello all,
I am attempting to execute an automated test (written in Python) via
cron. I have to check the HOSTNAME variable as part of the test, oddly
under cron the HOSTNAME environment variable is not in the os.environ
dictionary. I know that cron runs in a subshell that does not have all
of
t with the Google Data API. The Google Data API uses httplib to
> > place all of its requests. However I have been using urllib2 and some
> > handlers that I discovered in an ASPN article to handle HTTPS proxies
> > in my code.
>
> > The Google Data API relies on
d in an ASPN article to handle HTTPS proxies
> in my code.
>
> The Google Data API relies on an environment variable called
> https_proxy to get information about the proxy to be used. However
> urllib2 starts spitting out the BadStatusLine exception if the
> https_proxy envi
in my code.
The Google Data API relies on an environment variable called
https_proxy to get information about the proxy to be used. However
urllib2 starts spitting out the BadStatusLine exception if the
https_proxy environment variable is found.
Has anyone experienced similar things with urllib2? Is
"ken" <[EMAIL PROTECTED]> wrote:
>
>how can I find out the value of an environment variable in my pythong
>script?
C:\Apps\Python24>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright&qu
On Mar 5, 8:22 pm, "ken" <[EMAIL PROTECTED]> wrote:
> how can I find out the value of an environment variable in my pythong
> script?
>
> Thank you.
RTFM...
os.getenv
http://docs.python.org/lib/os-procinfo.html
Regards,
Jordan
--
http://mail.python.org/mailman/listinfo/python-list
how can I find out the value of an environment variable in my pythong
script?
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Fuzzyman wrote:
>
> > I *believe* that ``SetEnvironmentVariable`` exists in the underlying
> > windows API, but that it isn't wrapped by the win32api extension.
>
> SetEnvironmentVariable does the same thing as assignment to os.environ.
>
> The only way to set the environmen
Fuzzyman wrote:
> I *believe* that ``SetEnvironmentVariable`` exists in the underlying
> windows API, but that it isn't wrapped by the win32api extension.
SetEnvironmentVariable does the same thing as assignment to os.environ.
The only way to set the environment for another process is to create
Fuzzyman wrote:
>
> Magnus Lycka wrote:
>> Surely there must be a way to programatically set up the
>> environment variables for not yet started processes? I.e.
>> doing the same as when you manually change things in the
>> control panel. I'm pretty sure many Windows installers do
>> that, and wh
Magnus Lycka wrote:
> Duncan Booth wrote:
> > Fuzzyman wrote:
> >> In the ``win32api`` package there is a ``GetEnvironmentVariable``
> >> function, but no ``SetEnvironmentVariable``. Any options ?
> >
> > No, your only option is to find a solution which doesn't involve changing
> > another process
Duncan Booth wrote:
> Fuzzyman wrote:
>> In the ``win32api`` package there is a ``GetEnvironmentVariable``
>> function, but no ``SetEnvironmentVariable``. Any options ?
>
> No, your only option is to find a solution which doesn't involve changing
> another process's environment.
Surely there mus
Fuzzyman wrote:
> Hello all,
>
> I would like to set a Windows Environment variable for another
> (non-child) process.
>
> This means that the following *doesn't* work : ::
>
> os.environ['NAME'] = value
>
> In the ``win32api`` package there is
Hello all,
I would like to set a Windows Environment variable for another
(non-child) process.
This means that the following *doesn't* work : ::
os.environ['NAME'] = value
In the ``win32api`` package there is a ``GetEnvironmentVariable``
function, but no ``SetEnvironment
Fredrik Lundh wrote:
> what part of your observations makes you think that the environment isn't
> "captured" (i.e. > copied from the process environment) when the os module is
> imported ?
Answer: the part that was informed by a fundamental misunderstanding on
my part of how the os module obtai
[EMAIL PROTECTED] wrote:
> Do these observations fit with what is stated in section 6.1.1 of the
> Python Library Reference?
yes. what part of your observations makes you think that the
environment isn't "captured" (i.e. copied from the process environ-
ment) when the os module is imported ?
(h
hat the PATH variable was, in fact, changed)
5) in interactive window, del os
6) in interactive window, import os
7) os.environ['PATH'] - presents the same value as in #3
I also observed that if I exit the interactive window, and then go back
into the interactive window, the os.environ[
[EMAIL PROTECTED] wrote:
> O/S: Win2K
> Vsn of Python:2.4
>
> Based on a search of other posts in this group, it appears as though
> os.environ['PATH'] is one way to obtain the PATH environment variable.
>
> My questions:
> 1) is it correct that os.environ[
[EMAIL PROTECTED] wrote:
> Based on a search of other posts in this group, it appears as though
> os.environ['PATH'] is one way to obtain the PATH environment variable.
>
> My questions:
> 1) is it correct that os.environ['PATH'] contains the PATH environmen
O/S: Win2K
Vsn of Python:2.4
Based on a search of other posts in this group, it appears as though
os.environ['PATH'] is one way to obtain the PATH environment variable.
My questions:
1) is it correct that os.environ['PATH'] contains the PATH environment
variable?
2) are
;>> On 2005-10-24, Eric Brunel <[EMAIL PROTECTED]> wrote:
>>>> >> The only think you can export an environment variable to is a
>>>> >> child process
>>>> > Well, you know that, and I know that too. From my experience,
>>>> > m
Jorgen Grahn <[EMAIL PROTECTED]> writes:
> On Wed, 26 Oct 2005 07:42:19 -0700, Alex Martelli <[EMAIL PROTECTED]> wrote:
>> Grant Edwards <[EMAIL PROTECTED]> wrote:
>>> On 2005-10-24, Eric Brunel <[EMAIL PROTECTED]> wrote:
>>> >> The
On Wed, 26 Oct 2005 07:42:19 -0700, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Grant Edwards <[EMAIL PROTECTED]> wrote:
>
>> On 2005-10-24, Eric Brunel <[EMAIL PROTECTED]> wrote:
>>
>> >> The only think you can export an environment variable to i
Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2005-10-24, Eric Brunel <[EMAIL PROTECTED]> wrote:
>
> >> The only think you can export an environment variable to is a
> >> child process
> >
> > Well, you know that, and I know that too. From m
On 2005-10-24, Eric Brunel <[EMAIL PROTECTED]> wrote:
>> The only think you can export an environment variable to is a
>> child process
>
> Well, you know that, and I know that too. From my experience,
> many people don't...
True. Using Unix for 20+ years pr
On Fri, 21 Oct 2005 20:13:32 -, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2005-10-21, Mike Meyer <[EMAIL PROTECTED]> wrote:
>> Grant Edwards <[EMAIL PROTECTED]> writes:
>>> My point: the OP wanted to know how to export an environment
>>> vari
On 2005-10-21, Mike Meyer <[EMAIL PROTECTED]> wrote:
> Grant Edwards <[EMAIL PROTECTED]> writes:
>> My point: the OP wanted to know how to export an environment
>> variable to a child process. Either of the lines of code above
>> will do that, so what
Grant Edwards <[EMAIL PROTECTED]> writes:
> My point: the OP wanted to know how to export an environment
> variable to a child process. Either of the lines of code above
> will do that, so what's with all the shellular shenanigans?
Actually, the OP didn't say he wanted
hit. Are people being intentionally misleading??
>
> No. Are you being intentionally - never mind.
Well, yes, probably.
>> And even Google knows the correct answer
>>
>> http://www.google.com/search?hl=en&lr=&q=python+set+environment+variable
>>
>>
--
>
> Bullshit. Are people being intentionally misleading??
No. Are you being intentionally - never mind.
> And even Google knows the correct answer
>
> http://www.google.com/search?hl=en&lr=&q=python+set+environment+variable
>
> Follow the first hit.
The first h
calls a .sh script that executes the
> export command and then calls another .py script (and how would the
> first .py script look)?
Good grief, that's ugly. Just use os.putenv().
> That would be much more what is my basic problem.
And even Google knows the correct answer
http
Steve Holden wrote:
> Time you answered your own questions by trying things at the interactive
> interpreter prompt!
>
> regards
> Steve
Right again, Steve.
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Christian wrote:
> Steve Holden wrote:
>
>
>>::
>>one.py
>>::
>>import os
>>os.environ['STEVE'] = "You are the man"
>>os.system("python two.py")
>>print "Ran one"
>>::
>>two.py
>>::
>>import os
>>print "STEVE is", os.environ['STEVE']
>>print "Ran tw
Steve Holden wrote:
> ::
> one.py
> ::
> import os
> os.environ['STEVE'] = "You are the man"
> os.system("python two.py")
> print "Ran one"
> ::
> two.py
> ::
> import os
> print "STEVE is", os.environ['STEVE']
> print "Ran two"
> [EMAIL PROTECTED] t
> executed from a command promt than when executed from a starter .py script?
No; it's always the same: an environment variable will only be
effective in the process in which it is set, and its children.
When you call another program, whether it's a shell script, python
scr
Christian wrote:
>>The closest thing you can do is that:
>>
>>-myScript.py--
>>print 'export MY_VARIABLE=value'
>>--
>>
>>-myScript.sh--
>>python myScript.py > /tmp/chgvars.sh
>>.
Mike Meyer enlightened us with:
> It's simpler to use eval and command substitution:
>
> eval $(python myScript.py)
This looks like the best solution to me.
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just tak
Erik Max Francis wrote:
> Christian wrote:
>
>> Can I write a .py script that calls a .sh script that executes the
>> export command and then calls another .py script (and how would the
>> first .py script look)?
>
> No, the shell script that the Python program would invoke would be a
> differ
Christian wrote:
> Can I write a .py script that calls a .sh script that executes the
> export command and then calls another .py script (and how would the
> first .py script look)?
No, the shell script that the Python program would invoke would be a
different process and so commands executed
>
> The closest thing you can do is that:
>
> -myScript.py--
> print 'export MY_VARIABLE=value'
> --
>
> -myScript.sh--
> python myScript.py > /tmp/chgvars.sh
> . /tmp/chgvars.
"Eric Brunel" <[EMAIL PROTECTED]> writes:
> -myScript.py--
> print 'export MY_VARIABLE=value'
> --
>
> -myScript.sh--
> python myScript.py > /tmp/chgvars.sh
> . /tmp/chgvars.sh
I
On 2005-10-20, Christian <[EMAIL PROTECTED]> wrote:
> How do I export an environment variable in a .py script?
http://www.python.org/doc/current/lib/os-procinfo.html#l2h-1548
--
Grant Edwards grante Yow! My BIOLOGICAL ALARM
On 2005-10-20, the_crazy88 <[EMAIL PROTECTED]> wrote:
> os.system("export PYTHONPATH = %s" %("your_pythonpath"))
No, that won't work.
That will set the environment variable in the shell spawned by
the os.system command. That shell will then immediately exit
On 20 Oct 2005 01:58:44 -0700, the_crazy88 <[EMAIL PROTECTED]> wrote:
> Just use
> os.system("export PYTHONPATH = %s" %("your_pythonpath"))
... except it won't work: os.system will execute the command in a new process,
so the environment variable change w
Thanks Jeff and the crazy 88.
--
http://mail.python.org/mailman/listinfo/python-list
In Unix, you generally can't affect the environment of your parent program (in
a broad sense, which includes environment variables, current working directory,
opened files, effective user ID, etc).
You have two basic choices to achieve an effect like this. First, you can
start a subshell with the
Just use
os.system("export PYTHONPATH = %s" %("your_pythonpath"))
--
http://mail.python.org/mailman/listinfo/python-list
Another question from a not even newbie:
In Unix you can set an environment variable with the command
export PYTHONPATH
but I would like to set the variable from at .py script.
So my question is:
How do I export an environment variable in a .py script?
Thanks
Chris
--
http
[Vivek Chaudhary]
> Is it possible to set an environment variable in python script whose
> value is retained even after the script exits.
There is an indirect approach:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/159462
Raymond
--
http://mail.python.org/mailman/listinfo/
1 - 100 of 110 matches
Mail list logo