In Emacs, when I need to start a python interpreter, I have to run (python-shell-switch-to-shell)
, but then I always have to confirm two things:
- Confirm the
python-shell-interpreter-args
. - Confirm to make a dedicated process (y or n), it is really tedious to confirm them every time i need to start a python shell, is there a way to provide the default options and skip these steps?
Also, I found every time I have the python shell restarted, I have to manually run python-shell-send-setup-code
again to make the shell works properly. it seems this setup function only will be called when you start a new python shell, 'cus it is a hooked function for the inferior python mode, if you don't leave the python shell buffer, and restart the python shell within the same buffer, this setup function won't be called. Is there a way to solve this? e.g., by override the original python-shell-send-setup-code
or python-shell-switch-to-shell