Reputation:
I was looking at this Stack Overflow answer and in it the author says for the original poster to check if the PYTHONSTARTUP variable is defined. I looked around and can not find out how to check to see if it is defined.
How do you check to see if the PYTHONSTARTUP variable is defined?
Upvotes: 1
Views: 2084
Reputation: 41852
Windows (cmd.exe):
echo %PYTHONSTARTUP%
Elsewhere (in a shell, e.g. bash):
echo $PYTHONSTARTUP
In Python:
import os
print(os.environ['PYTHONSTARTUP'])
Upvotes: 1
Reputation: 7235
I assume it's an environment variable.
import os
if os.getenv("PYTHONSTART"):
do_something()
Upvotes: 0