Home >Backend Development >Python Tutorial >How to run python after installation
After you install Python, you can run it through the command prompt (Windows) or the terminal (Mac/Linux): Open a command window (Windows: cmd, Mac/Linux: Terminal). Type "python" to start the Python interpreter. Run the Python script using the "python filename.py" command. Type "exit()" to exit the Python interpreter.
How to run Python after installation
After installing Python, you can run it through the command prompt or terminal it. Here's how to do it:
1. Open a command prompt or terminal
2. Use Python commands
In the command window that opens, enter the following command:
<code>python</code>
You will see the Python explanation The server starts and displays an interactive shell.
3. Run Python script
To run a Python script, you need to use the following command:
<code>python 文件名.py</code>
where "filename.py" is The name of the script you want to run. For example, to run a script named "hello.py", type:
<code>python hello.py</code>
4. Exit the Python interpreter
To exit the Python interpreter, type The following command:
<code>exit()</code>
The above is the detailed content of How to run python after installation. For more information, please follow other related articles on the PHP Chinese website!