[Tutor] Fwd: OT (probably): How to change default tab key value to 4 spaces in GNOME Terminal?
boB Stepp
robertvstepp at gmail.com
Wed Apr 29 21:21:12 EDT 2020
On Wed, Apr 29, 2020 at 5:28 PM Alex Kleider <akleider at sonic.net> wrote:
> Bob, (or do you prefer 'boB'?)
boB please!
> I didn't know there was such a thing as a .pythonstartup file
> (although I see there is a .python_history file in my ~ directory.)
> (I'm using Debian Stable (10 I believe it is.))
> A little research took me here:
> https://www.assertnotmagic.com/2018/06/30/python-startup-file/
> and indicates that such a file can be called anything one would like:
> $ export PYTHONSTARTUP="~/.config/pythonrc.py"
>
> So thanks for the tip!
>
> I'm curious to know if it is run every time the interpreter starts, even
> if one is working within a virtualenv?
I haven't delved into virtual environments much yet, though I am using
pyenv to manage my Python versions per a suggestion by Mats a while
back. Anyway I added the following to the end of my .bashrc file:
# Set default text editor:
export EDITOR='nvim'
# Load pyenv automatically by adding
# the following to ~/.bash_profile:
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# Set Python 3 custom prompt:
export PYTHONSTARTUP=$HOME/.pythonstartup
Note that the .pythonstartup (Or whatever you choose to call it.) does
not exist until you create it. So this works for me, one environment
boB.
--
boB
More information about the Tutor
mailing list