On 03/12/17 18:32, John Yeung wrote:
> In the custom installation options for Python 3.6, what *exactly* does "Add
Python to environment variables" mean?
>
> Which environment variables are we talking about? I imagine one of them would
have to be PATH. Are there any others?
On 03/12/17 18:32, John Yeung wrote:
> In the custom installation options for Python 3.6, what *exactly* does "Add
> Python to environment variables" mean?
>
> Which environment variables are we talking about? I imagine one of them would
> have to be PATH. Are there any
In the custom installation options for Python 3.6, what *exactly* does "Add
Python to environment variables" mean?
Which environment variables are we talking about? I imagine one of them would
have to be PATH. Are there any others?
John Y.
--
https://mail.python.org/mailman/listi
On 3/23/2016 5:33 AM, Hongyi Zhao wrote:
Hi all,
I want to submit a qsub job to my hpc cluster from within python. In
this case, I must set some environment variables specific for this qsub
job and then invoking a bash script from within python.
What python code should be used for this job
Hi all,
I want to submit a qsub job to my hpc cluster from within python. In
this case, I must set some environment variables specific for this qsub
job and then invoking a bash script from within python.
What python code should be used for this job?
Regards
--
.: Hongyi Zhao [ hongyi.zhao
On Thu, 22 Sep 2011 09:21:59 +0200, Thomas Rachel wrote:
[snip]
> $ python -c 'import os; print "\n".join(sorted("%s=%s" % (k,v) for k,v
> in os.environ.iteritems()))' | diff -u - <(env|LANG=C sort)
[standing ovation]
--
To email me, substitute nowhere->spamcop, invalid->net.
--
http://mail.py
Thomas Rachel writes:
> Am 22.09.2011 12:16 schrieb Ben Finney:
> > --
> > \ “As far as the laws of mathematics refer to reality, they are |
> >`\not certain, and as far as they are certain, they do not refer |
> > _o__) to reality.” —Albert Einstein, 1
Am 22.09.2011 12:16 schrieb Ben Finney:
--
\ “As far as the laws of mathematics refer to reality, they are |
`\not certain, and as far as they are certain, they do not refer |
_o__) to reality.” —Albert Einstein, 1983 |
Ben Finney
So, he said what in
Ben Finney wrote:
> Steven D'Aprano writes:
>
>> I don't understand why some environment variables are not visible from
>> Python.
>
> Not all variables are environment variables. Variables only become
> environment variables if exported to the environment;
Steven D'Aprano writes:
> I don't understand why some environment variables are not visible from
> Python.
Not all variables are environment variables. Variables only become
environment variables if exported to the environment; the ‘export’
command is one way to do that.
--
Am 22.09.2011 08:12 schrieb Steven D'Aprano:
I don't understand why some environment variables are not visible from
Python.
[steve@wow-wow ~]$ echo $LINES $COLUMNS $TERM
30 140 xterm
[steve@wow-wow ~]$ python2.6
Python 2.6.6 (r266:84292, Dec 21 2010, 18:12:50)
[GCC 4.1.2 20070925 (Red
hello,
On Thu, Sep 22, 2011 at 06:12:01AM +, Steven D'Aprano wrote:
> I don't understand why some environment variables are not visible from
> Python.
>
> [steve@wow-wow ~]$ echo $LINES $COLUMNS $TERM
> 30 140 xterm
> [steve@wow-wow ~]$ python2.6
> Python 2.6
On Thu, Sep 22, 2011 at 11:42 AM, Steven D'Aprano
wrote:
> I don't understand why some environment variables are not visible from
> Python.
>
> [steve@wow-wow ~]$ echo $LINES $COLUMNS $TERM
> 30 140 xterm
> [steve@wow-wow ~]$ python2.6
> Python 2.6.6 (r266:84292
I don't understand why some environment variables are not visible from
Python.
[steve@wow-wow ~]$ echo $LINES $COLUMNS $TERM
30 140 xterm
[steve@wow-wow ~]$ python2.6
Python 2.6.6 (r266:84292, Dec 21 2010, 18:12:50)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2
Type "help&qu
On 12Aug2010 01:28, Nobody wrote:
| On Wed, 11 Aug 2010 13:08:59 +1000, Cameron Simpson wrote:
| > The reason .bashrc gets overused for envars, aside from ignorance and
| > propagated bad habits, is that in a GUI desktop the setup sequence is
| > often a bit backwards. A conventional terminal/cons
On Wed, 11 Aug 2010 13:08:59 +1000, Cameron Simpson wrote:
> The reason .bashrc gets overused for envars, aside from ignorance and
> propagated bad habits, is that in a GUI desktop the setup sequence is
> often a bit backwards. A conventional terminal/console login means you
> get a login shell th
On 11Aug2010 13:08, I wrote:
| On 10Aug2010 10:07, Steven W. Orr wrote:
[...]
| | After that, and again, be aware that the .bashrc alone is executed for login
| | shells *which are not interactive*. for example:
| |
| | ssh somemachine 'echo Hello'
| |
| | This command will *not* go through the
e
| > empty (except a source statement for .bashrc) and put all your settings,
| > aliases, exports, etc. in .bashrc.
|
| Sorry. Dead wrong. Please reread the above comment I wrote. If you set your
| environment variables in the .bashrc then you completely lose the ability of
| env
ttings,
> aliases, exports, etc. in .bashrc.
>
> Thorsten
Sorry. Dead wrong. Please reread the above comment I wrote. If you set your
environment variables in the .bashrc then you completely lose the ability of
environment variables to be inherited by sub-shells. Again, envvars should
* Tim Chase (Mon, 26 Jul 2010 21:42:24 -0500)
> On 07/26/10 21:26, Steven W. Orr wrote:
> > Please! Never export anything from your .bashrc unless you
> > really know what you're doing. Almost all exports should be
> > done in your .bash_profile
>
> Could you elaborate on your reasoning why (or wh
On 07/26/10 22:42, quoth Tim Chase:
> On 07/26/10 21:26, Steven W. Orr wrote:
>> Please! Never export anything from your .bashrc unless you
>> really know what you're doing. Almost all exports should be
>> done in your .bash_profile
>
> Could you elaborate on your reasoning why (or why-not)? I've
tings. But it only works for shells (and only for
bash shells, and only for interactive bash shells), while your environment
settings should be available to everything, regardless of whether it was
spawned from an interactive bash shell or from some other program.
Also, if you update environment v
On Mon, 26 Jul 2010 22:26:27 -0400, Steven W. Orr wrote:
> Please! Never export anything from your .bashrc unless you really know
> what you're doing. Almost all exports should be done in your
> .bash_profile
Would you like to explain why, or should we just trust you?
--
Steven
--
http://mail
On 07/26/10 21:26, Steven W. Orr wrote:
Please! Never export anything from your .bashrc unless you
really know what you're doing. Almost all exports should be
done in your .bash_profile
Could you elaborate on your reasoning why (or why-not)? I've
found that my .bash_profile doesn't get evalua
On 07/26/10 20:02, quoth Chris Rebert:
> On Mon, Jul 26, 2010 at 4:36 PM, Peng Yu wrote:
>
> You need to "export R_HOME" in bash (probably in your .bashrc or
> .bash_profile). See
> http://www.ibm.com/developerworks/library/l-bash.html#N10074
Please! Never export anything from your .bashrc unles
now what is the correct way to inherent
| all the environment variables form the shell?
|
| $ echo $R_HOME
| /opt/R-2.11.1
| $ cat main.py
| #!/usr/bin/env python
|
| import os
|
| print os.environ['R_HOME']
| $ ./main.py
| Traceback (most recent call last):
| File "./main.py",
me know what is the correct way to inherent
all the environment variables form the shell?
os.environ does capture all the environment that the shell passes to it.
In this case, you haven't exported R_HOME, so the shell doesn't export
it, so os.environ has no chance to capture it.
rho..
> shell. Could anybody let me know what is the correct way to inherent
> all the environment variables form the shell?
>
> $ echo $R_HOME
> /opt/R-2.11.1
> $ cat main.py
> #!/usr/bin/env python
>
> import os
>
> print os.environ['R_HOME']
> $ ./
Hi,
R_HOME is set in my shell (bash). But os.environ doesn't have it. I'm
not sure what it does when os module is imported. But it seems that
os.environ doesn't capture all the environment variable from the
shell. Could anybody let me know what is the correct way to inherent
all
On Feb 24, 2009, at 4:34 PM, Brandon Taylor wrote:
Here's my setup: OS X (10.5.6 - Intel), Oracle Instant Clinet 10_2,
Python 2.6.1, Django trunk
OS X is an important detail here.
In my .bash_profile, I have ORACLE_HOME and LD_LIBRARY_PATH specified
as:
ORACLE_HOME="$HOME/Library/Oracle/inst
Hello everyone,
Here's my setup: OS X (10.5.6 - Intel), Oracle Instant Clinet 10_2,
Python 2.6.1, Django trunk
I have my Oracle instantclient folder at: /Users/bft228/Library/Oracle/
instantclient_10_2
In my .bash_profile, I have ORACLE_HOME and LD_LIBRARY_PATH specified
as:
ORACLE_HOME="$HOME/
On Sep 11, 10:25 am, nntpman68 <[EMAIL PROTECTED]> wrote:
> >> doesn't exactly work for Python scripts, though:
>
> >> $ cat env.py
> >> #!/usr/bin/env python
> >> import os
> >> os.environ["TEST"] = "hello"
>
> >> $ . ./env.py && env | grep TEST
> >> import: unable to open X server `'.
> >> bash:
doesn't exactly work for Python scripts, though:
$ cat env.py
#!/usr/bin/env python
import os
os.environ["TEST"] = "hello"
$ . ./env.py && env | grep TEST
import: unable to open X server `'.
bash: os.environ[TEST]: command not found
There's two options for the desperate ones.
1. Assumin
>
> doesn't exactly work for Python scripts, though:
>
True, but you can use it in the following (admittedly messy) way:
jl> cat setenv.sh
/usr/bin/env python $@
. ./settmp
rm settmp
jl> cat env.py
#!/usr/bin/python
command = "export TEST='hello'\n"
open('settmp', 'w').write(command)
jl> . sete
John Lawrence wrote:
You can make a command use the current shell though if you use the '.'
command e.g.:
jl > cat env.sh
export TEST='hello'
jl > ./env.sh && env | grep TEST #Doesn't set TEST in parent shell
jl > . ./env.sh && env | grep TEST #Adding '. ' before the
comman
>
> when a process starts, it gets a *copy* of the parent's environment. it
> can modify that copy, but it cannot modify the variables in the parent.
You can make a command use the current shell though if you use the '.'
command e.g.:
jl > cat env.sh
export TEST='hello'
jl > ./env.sh && env |
aditya shukla wrote:
Can i add any environment variable to bash from my python script? so
that when i use env command then i can see that environment variable.
not if you run the script from the shell.
when a process starts, it gets a *copy* of the parent's environment. it
can modify that c
Hello folks
Can i add any environment variable to bash from my python script? so that
when i use env command then i can see that environment variable.
Thanks
Aditya
--
http://mail.python.org/mailman/listinfo/python-list
aditya shukla wrote:
now this dosen't change the value of the variable which was set earlier
.Please help me in fixing this issue.
Are you trying to modify or add an environment var so the change is
visible from the calling shell? That's not possible. You can't change
the env var of a parent
Hello folks, i am working with Python-2.5.2, fedora 9 sulphur
I wanna change the value of environment variable , so if i open bash and
type
envvariable=value;export variable then this sets the envvariable equal to
the value.Now i am writing a python script to set the value of this
environment v
to read it:
path = os.environ["MYVARIABLE"]
> Also how do i create environment variable for prog1?
that depends on what platform (and shell) you're using. on Windows, you
can set environment variables via the SET command, or, permanently, via
the control panel (
Hello folks,
How can i create environment variables using python?
Aditya
--
http://mail.python.org/mailman/listinfo/python-list
Hello folks,
I am writing a program(prog 1) in python , which requires to know the path
of another program(prog 2) in order to execute.I can get my prog1 to work
when i hard code the path of the existing program(prog2).But since the path
of prog could be anywhere on the file system , thus i cannot
nding this to include other sources of control inputs.
I think a reasonable heirarchy is:
Interactive Input
> Command Line Argument
> Command Line Input File
> Environment Variables
> Local Defaults File
> System Wide Defaults File
> Installation Default
_db': 'test_env'}
> > [EMAIL PROTECTED] ~/proj/mddl4/test $ ./inputs.py -f "test_cli"
> > {'source_db': 'test_cli'}
>
> A good start. However, you need to account for two conventions with
> configuration of programs via enviro
> {'source_db': 'test_cli'}
A good start. However, you need to account for two conventions with
configuration of programs via environment variables:
* Environment variables that will be inherited by subprocesses are
conventionally distinguished from variables that will not
ome.db'}
[EMAIL PROTECTED] ~/proj/mddl4/test $ source_db="test_env" ./inputs.py
{'source_db': 'test_env'}
[EMAIL PROTECTED] ~/proj/mddl4/test $ ./inputs.py -f "test_cli"
{'source_db': 'test_cli'}
For the file
=
#!/usr/bin/env python
r me all the
> > > time. Please help me with the following questions:
>
> > > When I install python in a new system, I will go to environment
> > > variables (system variables) and set "path" pointing to C:\Python25
> > > and thats all I do.
> >
ions:
>
> > When I install python in a new system, I will go to environment
> > variables (system variables) and set "path" pointing to C:\Python25
> > and thats all I do.
> > I type python from "cmd" window and its converting to python window
> >
Krishna wrote:
Environment variable set up is the most confusing part for me all the
time. Please help me with the following questions:
When I install python in a new system, I will go to environment
variables (system variables) and set "path" pointing to C:\Python25
and thats all I
On Apr 25, 8:07 am, Krishna <[EMAIL PROTECTED]> wrote:
> Environment variable set up is the most confusing part for me all the
> time. Please help me with the following questions:
>
> When I install python in a new system, I will go to environment
> variables (system var
Environment variable set up is the most confusing part for me all the
time. Please help me with the following questions:
When I install python in a new system, I will go to environment
variables (system variables) and set "path" pointing to C:\Python25
and thats all I do.
I type python
Wang, Harry wrote:
> Need some suggestions as to how to set environment variable in Windows XP.
os.environ['SUX'] = 'windowsxp'
> Got XML which has a timestamp in Eastern Standard time, but would like to
> strip it out for comparison with expected result.
Example?
--
James Stroud
UCLA-DOE In
Need some suggestions as to how to set environment variable in Windows XP.
Got XML which has a timestamp in Eastern Standard time, but would like to strip
it out for comparison with expected result.
Harry C. Wang
Automated Tester
AOL Mobile
--
http://mail.python.org/mailman/listinfo/python-l
ub process of bash).
>>
> "calling shell"... Only OS I've encountered that allowed for a form
> of that was AmigaOS, which differentiated between "shell specific"
> (local) environment variables:
>
> set lev "A Local Environment Variable"
Michal 'vorner' Vaner wrote:
> Hello,
>
> On Mon, Mar 12, 2007 at 11:40:11AM +0100, Diez B. Roggisch wrote:
>> Maxim Veksler wrote:
>> > I'm trying to write a python script that would allow me to manipulate
>> > shell variables of the calling shell. I'm trying to write some logic
>> > that would
Hello,
On Mon, Mar 12, 2007 at 11:40:11AM +0100, Diez B. Roggisch wrote:
> Maxim Veksler wrote:
> > I'm trying to write a python script that would allow me to manipulate
> > shell variables of the calling shell. I'm trying to write some logic
> > that would know to add LD_LIBRARY_PATH to the users
ank you,
> > Maxim.
> This is not possible to do directly.
> There is however a possibility to solve this problem under special
> circumstances.
> 1. Your python (/perl/shell/etc) script must write the wanted
> environment
> variables to standard ou
m under special
circumstances.
1. Your python (/perl/shell/etc) script must write the wanted
environment
variables to standard out, as key-value pairs with a suitable separator.
2. The invoking shell must agree with your script as to what
separator is used.
3. In
ARY_PATH to the users environment.
>
> In bash this is done with "export", can I do this with python? (If at
> all possible because python is actually a sub process of bash).
>
The Popen class from the subprocess module takes an optional 'env'
parameter, which defi
Maxim Veksler wrote:
> Hello list,
>
> I'm trying to write a python script that would allow me to manipulate
> shell variables of the calling shell. I'm trying to write some logic
> that would know to add LD_LIBRARY_PATH to the users environment.
>
> In bash this is done with "export", can I do
Hello list,
I'm trying to write a python script that would allow me to manipulate
shell variables of the calling shell. I'm trying to write some logic
that would know to add LD_LIBRARY_PATH to the users environment.
In bash this is done with "export", can I do this with python? (If at
all possibl
On Feb 9, 6:47 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 9 fév, 12:30, "Kai Rosenthal" <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > how can I resolve envionment variables in a string.
> > e.g.
>
> > strVar = /myVar
> > resolve in
>
> nothing. This raises a SyntaxError. Python is *not
On 9 fév, 12:30, "Kai Rosenthal" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> how can I resolve envionment variables in a string.
> e.g.
>
> strVar = /myVar
> resolve in
nothing. This raises a SyntaxError. Python is *not* a shell script
language.
> str1 = /mytest02/$MYVAR/mytest02 --> /mytest02//m
Hello,
how can I resolve envionment variables in a string.
e.g.
strVar = /myVar
resolve in
str1 = /mytest02/$MYVAR/mytest02 --> /mytest02//myVar/mytest02
(unix)
str2 =$MYVAR/mytest03 --> /myVar/mytest03 (unix)
str3 =%MYVAR%/mytest03 --> /myVar/mytest03 (windows)
I would not set the va
At Thursday 11/1/2007 11:45, Tristan wrote:
I considered to use it, thanks!! Incidentally (beg your pardon if it
sounds to ignorance), can I define Environment variables in a config
file and then apply to my python program?
Yes, read them from the config file and then use os.environ['
Thanks Gabriel.
> What kind of environment variables? Those used by Python itself, like
> PYTHONPATH? Or your own variables, like FOO_LOCATION=C:\My\Projects\Lib\Foo
I need to add to PYTHONPATH and other enviroment variables asked, for
example, by DJANGO or other python products.
> I
At Wednesday 10/1/2007 23:24, Tristan wrote:
1) For almost everyone, I execute a corresponding ".bat file" into
which I define and/or include values for some "temporal"
environment variables that let me find all the objects that the
selected application uses. Someti
to use these applications is:
1) For almost everyone, I execute a corresponding ".bat file" into
which I define and/or include values for some "temporal"
environment variables that let me find all the objects that the
selected application uses. Sometimes I include
to use these applications is:
1) For almost everyone, I execute a corresponding ".bat file" into
which I define and/or include values for some "temporal"
environment variables that let me find all the objects that the
selected application uses. Sometimes I include
to use these applications is:
1) For almost everyone, I execute a corresponding ".bat file" into
which I define and/or include values for some "temporal"
environment variables that let me find all the objects that the
selected application uses. Sometimes I include in the .ba
On Fri, 22 Jul 2005 10:56:22 -0500,
David Durkee <[EMAIL PROTECTED]> wrote:
> I didn't get much from the discussion of Command Substitution. Any tips
> on how to do that?
I don't use tcsh, so there may be some subtleties I don't get, but it's
going to look something like this:
c
to write a script I can run from tcsh in Terminal (on Mac
>> OS X) that will set environment variables that can be accessed by
>> subsequent commands I execute in that session. Not having any luck so
>> far. Here's what I've tried:
>>
>>
>
> By desi
On Thu, 21 Jul 2005 21:39:01 -0500,
David Durkee <[EMAIL PROTECTED]> wrote:
> I'm trying to write a script I can run from tcsh in Terminal (on Mac
> OS X) that will set environment variables that can be accessed by
> subsequent commands I execute in that session. Not havi
Hi,
I'm trying to write a script I can run from tcsh in Terminal (on Mac
OS X) that will set environment variables that can be accessed by
subsequent commands I execute in that session. Not having any luck so
far. Here's what I've tried:
#!/usr/bin/python
import sys
There is nothing that plainly differentiates whether an environment
variable is the system's or the current user's.
What you could do is:
1. Get the list of environment variables for the user the script is
executing as.
2. Use the pywin32 extensions to access the registry key
HKCU\Env
could ildg wrote:
> To a environment variable in Windows, can python know if it is a
> system environment
> variable or a current-user environment variable?
Not just by using the "os.environ" approach.
You would have to resort to the "pywin32"
extensions. Check the Python Cookbook using
Google fo
To a environment variable in Windows, can python know if it is a
system environment
variable or a current-user environment variable?
--
鹦鹉聪明绝顶、搞笑之极,是人类的好朋友。
直到有一天,我才发觉,我是鹦鹉。
我是翻墙的鹦鹉。
--
http://mail.python.org/mailman/listinfo/python-list
78 matches
Mail list logo