Visual studio code interactive python console

后端 未结 3 444
别那么骄傲
别那么骄傲 2021-02-07 00:22

I\'m using visual studio code with DonJayamanne python extension. It\'s working fine but I want to have an interactive session just like the one in Matlab, where after code exec

相关标签:
3条回答
  • 2021-02-07 00:47

    The following line will solve your problem.

     "python.terminal.launchArgs": ["-c","\"from IPython import embed; embed()\""]
    
    0 讨论(0)
  • 2021-02-07 00:51

    I added the following lines into user setting file, then it works. Select some lines of python code, then right-click and select Run selected code in python terminal

    Solution 1: Will start iPython terminal

       "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
       "terminal.integrated.shellArgs.windows": ["/K ipython"],
    

    Solution 2: Will start a terminal like "python -i"

       "python.terminal.launchArgs": ["-i"],
    
    0 讨论(0)
  • 2021-02-07 00:54

    I'm the author of the extension. There are two options:

    1. Use the integrated terminal window (I guess you already knew this)
      Launch the terminal window and type in python.
      Every statement executed in the REPL is within the same session.

    2. Next version will add support for Jupyter.
      Please have a look here for some samples of what is yet to come:

      • #303
      • Screen samples and more
    0 讨论(0)
提交回复
热议问题