Tools for writing code in Python - an interactive environment

The interactive environment means that when we enter a line of code and press Enter, the code will be executed immediately and the results will be generated and displayed in the window.

To open the Python interactive environment, the specific operations are as follows (win system):

Press WIN+R on the keyboard, and then enter the command "cmd" to open the command prompt window, enter: python in the window path, and press the Enter key to enter the python interactive environment, as shown below:

By entering 36+20, print('hello') and pressing the Enter key, the result will be output immediately. Entering quit() will exit the current interactive environment.

The above is the default interactive environment of python, but it is not very easy to use. We can use IPython, which provides more powerful editing and interactive functions.

First, we set up downloading through domestic mirrors, as shown below, enter the command: pip config set global.index-url https://pypi.doubanio.com/simple

Then install IPython by entering the command: pip install ipython:

Similarly, we enter the ipython interactive environment by typing ipython, and we will see that this environment has other advantages such as highlighting. 

Supongo que te gusta

Origin blog.csdn.net/mr_five55/article/details/135375167
Recomendado
Clasificación