How does python handle the program cannot be opened

When you install python, you can write statements in the python environment.

There are two ways to open the python environment: the first way is to find and open python.exe in the python folder; the second way is to search and enter cmd in the Windows system, enter the command line mode, and enter python (provided that it has been configured Environment variables). One feature of the python environment is that there are three greater than signs in front of each input line. In the python environment, you can enter a short python command and press Enter to get feedback.

But if you want to write an independent larger python file, you can right click to create a new txt file, and then change the .txt suffix to .py. When selecting the opening method, select IDLE mode to edit. For convenience, you can right-click to select properties, change the opening mode, and select IDLE as the default opening mode, you can double-click to open and enter the editing page. If you want to run on the editing page, click f5 To run.

Note: Notepad++ cannot be used, HTML can be used, but python files are not!

Some children's shoes want to run the python file directly, you can use the cmd command line, first switch to the file path to be run, enter the python file name, and then print the result in the command line window.

Some students directly use python.exe to open the py file, and a black window will flash by at this time. This is because it executes the command very quickly. If there is no result left, it will flash back. . In response to this situation, there are several opening methods for children's shoes to choose from.

1、 You can use the eclipse tool to open,

2、 Add an input() directly after the py file,

3、 Download appium/python-client and run the program directly.

Knowledge point expansion:

CMD cannot run python program to solve

Methods as below.

1、 Open a text editor, recommend editplus, notepad, etc., save the file in .py format, editplus and notepad support python syntax recognition. Be sure to write #!usr/bin/python on the first line of the script, indicating that the script file is an executable python script. If your python directory is not in the usr/bin directory, replace it with the current python executable directory.

2、 Pay attention to debugging after writing the script, you can directly use editplus to debug. The debugging method can be Baidu. After the script is written, open the CMD command line, provided that python has been added to the environment variable.

3、 In the CMD command line, enter "python" + "space", that is, "python"; drag the script file that has been written to the current cursor position, and then press Enter to run.

So far, this article on how python handles the program can’t be opened is introduced. For more related python programs can’t be opened, please search for the previous articles of ZaLou.Cn or continue to browse the related articles below. Hope you will support more in the future ZaLou.Cn!

Recommended Posts

How does python handle the program cannot be opened
How to save the python program
How does python improve the calculation speed
How does python call the key of a dictionary
How does python get input examples from the keyboard
How does python judge the module installation is complete
How does Python output integers
How does python update packages
Solve the problem that the Ubuntu 17.10 settings panel cannot be opened
How does python perform matrix operations
How does Python list update value
How does python call java classes
How does python import dependency packages
How does python enter interactive mode
How does Python generate xml files
How Python implements the timer function
How to view the python module
How does python determine prime numbers
How does python call its own function
How to learn the Python time module
How does python distinguish return and yield
How does Python call cmd using OS modules
How to use the round function in python
How to use the zip function in Python
How to program based on interfaces in Python
What does the tab key in python mean
How to use the format function in python
Can the value of the python dictionary be modified?
How to enter python through the command line
How about learning python at the age of 27?
How to switch the hosts file using python
How to install the downloaded module in python
How to write a confession program in python
Python how to move the code collectively right
Python is short-what does the spirit cage say
How does Python store data to json files