File: pyedit-products/unzipped/docetc/examples/RunCode-examples/env test 2.py

# See envtest2.py: this variant has spaces in script name, adding extra quotes
# to command lines, but its output (includig sys.argv) is otherwise the same.
# Run Code supports shell syntax for arguments, and quotes or escapes the names
# of the file and the Python executable as required for the host platform.

import sys, os
print(sys.path)
print('-'*40)
print(sys.executable)
print('-'*40)
print(sys.argv)
print('-'*40)
print(os.environ['PATH'])
print('-'*40)
for key in sorted(os.environ):
   print(key, '=>', os.environ[key])



[Home page] Books Code Blog Python Author Train Find ©M.Lutz