Posts: 4,647
Threads: 1,494
Joined: Sep 2016
Dec-25-2021, 09:16 PM
(This post was last modified: Dec-26-2021, 05:40 AM by Skaperen.
Edit Reason: fixed typo
)
on Xubuntu 18.04.6 LTS when i run Python 3.6.9 interactively (no command line options or arguments) with environment variable PYTHONSTARTUP set to ".init.py" it does not run the statements in that file. what am i doing wrong? i am reading here:
https://docs.python.org/3/using/cmdline....HONSTARTUP
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
Dec-26-2021, 05:49 AM
(This post was last modified: Dec-26-2021, 05:50 AM by Skaperen.)
(Dec-25-2021, 09:42 PM)BashBedlam Wrote: export PYTHONSTARTUP='/home/user_name/.init.py
i did all that, myself, plus the closing quote. but, alas! i now see my error. it's not even a Python error. i forgot the "export" word. so it would just set an ordinary shell variable. python would not get it. of course it's my mistake. your missing quote made me focus on this and that led to me seeing "export". thanks!
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i would soon get tired of doing that and make it be more permanent.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i want it to always read it from the user's home directory, never from the current working directory, for security reasons. so, ultimately i would set in in my ~/.bashrc file so it gets set at login or shell startup.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
perhaps it is more flexible. but i still prefer to run CPython in case there are differences. i use interactive mode very often to ensure behavior for cases of documentation that is missing or ambiguous. today i did that to verify how instances of decimal.Decimal worked in the
divmod()
function.
do you (anyone) use IPython for a particular reason (if so, what is the reason, and in what cases)
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.