IN and >>> of PyCharm Console

The Python Console is called the Python console, which is the Python interactive mode; the Terminal is called the terminal, which is the command line mode.
There are two main Python interactive modes: CPython uses >>> as a prompt, and IPython uses In [number]: as a prompt.
The Python interactive mode can directly enter the code, then execute it, and get the result immediately, so the Python interactive mode is mainly used for debugging Python code.
The command line mode is the same as the system's CMD (command prompt) and can run various system commands.
insert image description here
insert image description here

Use >>> as a prompt

  1. If the ipython package is not installed in the virtual environment, the default is >>> mode
  2. If IN[serial number] is currently displayed, and you want to change it back to >>>, uncheck the following boxes in File->Setting, Apply->OK
    insert image description here
    and restart the PyCharm application ( it is useless to restart the Console after testing )
    insert image description here
    insert image description here

Use IN[number] as a prompt

  1. Check the following boxes in File->Setting, Apply->OK
    insert image description here
  2. Restart PyCharm ( only restarting Console is invalid after testing )
  3. If it is still in >>> mode, it means that iPython is not installed in your environment. You can install it with conda install ipython. After the installation is complete, restart PyCharm again to switch to IN [serial number] mode.

Guess you like

Origin blog.csdn.net/qq_42283621/article/details/124107364