How do I load a file into the python console?

前端 未结 8 2324
攒了一身酷
攒了一身酷 2020-12-12 09:28

I have some lines of python code that I\'m continuously copying/pasting into the python console. Is there a load command or something I can run? e.g. load

8条回答
  •  暖寄归人
    2020-12-12 10:01

    If you're using IPython, you can simply run:

    %load path/to/your/file.py
    

    See http://ipython.org/ipython-doc/rel-1.1.0/interactive/tutorial.html

提交回复
热议问题