Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1288

Python • Re: Main file @ Desktop/startup import files in Documents

$
0
0
  1. Set the environment variable PYTHONPATH to include the desired directory before running the script.
  2. Change the cwd to the desired directory before running the script
  3. Use pythons OS module to manipluate $PYTHONPATH prior to doing the imports
  4. Using the sys module, manipulate sys.path to contains the desired directory
  5. Stuff everything into a zip file and pass that to the python interpreter
You may want to read the relevant bits of the python documentation and some basic shell scripting guides.

Statistics: Posted by thagrol — Thu May 09, 2024 5:08 pm



Viewing all articles
Browse latest Browse all 1288

Trending Articles