run python command line interpreter with imports loaded automatically

后端 未结 5 630
执笔经年
执笔经年 2021-02-07 02:54

I would like to play around in the python interpreter but with a bunch of imports and object setup completed. Right now I\'m launching the interpreter on the command line and do

5条回答
  •  萌比男神i
    2021-02-07 03:13

    I use PYTHONSTARTUP.

    My .bash_profile has a path to my home folder .pyrc, which as the import statements in it.

    https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP

提交回复
热议问题