How to run a file in python: first press the [win r] key and enter cmd to open the cmd window; then drag the [.py] file into the cmd window or enter the file path; finally press Enter. run.
【Related learning recommendations: python tutorial】
How to run files in python:
Method 1: cmd window
1. Press win r at the same time, enter cmd, and press Enter, that is The cmd window can be opened.
2. Drag the .py
file into the cmd window, or enter the file path and press Enter to run.
Method 2: python comes with IDLE tool
1. Find the python folder in the start menu and open the IDLE tool.
#2. Click file--open in sequence, find the required .py file, open it, and press F5 to execute.
The above is the detailed content of How to run files in python. For more information, please follow other related articles on the PHP Chinese website!