Python-Hello, World (Use of VS Code)

Python can be run in two modes: interactive mode and script mode.

Use script mode: You need to open an editor, create a Python script file, and then use Python + file name to run the script in the command line window.

Use Anaconda to demonstrate two modes:

Interactive mode: enter the environments option, click the green triangle on the right side of base-"open with Python

To exit, enter the exit function or the quit function, in Windows system, you can also use ctrl Z to exit 

Script mode:

First understand VS Code, it is a lightweight, powerful source code editor. Supports Windows, macOS and Linux. Support JavaScript, TypeScript and Node.js. Extensive ecosystem of other languages ​​(C++, C#, Java, Python, PHP, Go)

Open VS Code in the Home page of ANACONDA, open the VS Code resource management menu, open the folder where the code is stored through the Open Folder button, create a new file hello_world.py through the button next to the new file, and write in the newly created script file Enter the code, open the VS Code terminal through ctrl ~ after completion, use python + file name to run the script in the terminal

 

 

Guess you like

Origin blog.csdn.net/weixin_42596333/article/details/104535883