Score:0

Disable .pythonrc only in Python 2

it flag

Thanks to this assignment:

export PYTHONSTARTUP=~/.pythonrc

I can start an initialization script as soon as I run Python, a bit like the .bashrc file. The problem is that this works on both Python2 and Python3, instead I want to prevent Python2 from doing this, due to hassles with code in .pythonrc.
I know I can put an If in the .pythonrc file to block its execution in Python2, but I would like to avoid doing this and stop it from running the script in the bud.
Is there a possible way to do this or an alternative variable that works only with Python3 equivalent to PYTHONSTARTUP (eg. PYTHON3STARTUP)?
All solutions that allow me not to insert code inside the .pythonrc file are accepted.
Even an answer that says that this way does not exist (citing a source or providing evidence) is accepted.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.