May-29-2024, 11:48 PM
(May-29-2024, 07:58 PM)Gribouillis Wrote: Here is a third untested way, if you don't want to define PYTHONSTARTUP (I never define permanently python-related environment variables). In file usercustomize.py write this
# in usercustomize.py import sys if hasattr(sys, 'ps1'): # we are in interactive mode with open('spam.py') as ifh: exec(ifh.read(), vars(sys.modules['__main__']))
could i just put some other code in place of open+exec lines, under the test for interactive, to do what i want to happen in interactive?
can file usercustomize.py be put in the user's home directory?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.