Automatically execute commands on launching python shell

后端 未结 2 1717
深忆病人
深忆病人 2020-12-19 07:17

I was wondering if there is a way to automatically run commands on entering the python shell as you would with the .bash_profile or .profile scripts with bash. I would like

相关标签:
2条回答
  • 2020-12-19 07:44

    Also consider using ipython if you're doing a lot of interactive work. Your options for this kind of automation expand significantly.

    0 讨论(0)
  • 2020-12-19 07:53

    Yup you can use the PYTHONSTARTUP environment variable to do this as outlined here

    0 讨论(0)
提交回复
热议问题