Using IPython console along side IPython notebook

后端 未结 2 530
[愿得一人]
[愿得一人] 2021-01-30 17:46

While working on an IPython notebook, I\'m increasingly finding myself wishing that the notebook would have a console attached to it, for interactive programming. I find myself

2条回答
  •  自闭症患者
    2021-01-30 18:06

    Just do %qtconsole in one cell, and it will start a qtconsole attached to the same kernel. Of course your kernel need to be local.

    you can of course use the long method :

    In [1]: %connect_info
    {
      "stdin_port": 50845, 
      "ip": "127.0.0.1", 
      "control_port": 50846, 
      "hb_port": 50847, 
      "signature_scheme": "hmac-sha256", 
      "key": "c68e7f64-f764-4417-ba3c-613a5bf99095", 
      "shell_port": 50843, 
      "transport": "tcp", 
      "iopub_port": 50844
    }
    
    Paste the above JSON into a file, and connect with:
        $> ipython  --existing 
    or, if you are local, you can connect with just:
        $> ipython  --existing kernel-45781.json 
    or even just:
        $> ipython  --existing 
    if this is the most recent IPython session you have started.
    

    then

     ipython qtconsole --existing kernel-45781.json
    

提交回复
热议问题