Home > other >  Python is a batch file
Python is a batch file

Time:10-01

Is "quick learning python programming, giving tedious work automation" in section 6.3, the password box, after finishing the program, trying to make a batch file, the problem is as follows:

And created. Py files. All bat file on the Desktop: C: \ Users \ \ Desktop \ MyPythonScripts with ouyang, started using WIN + R, input "python pw. Py CSDN" program can not run (on the clipboard can't replicate CSDN password), as a small white, struggle for a long time found that CMD the default path is C: \ Users \ ouyang red ,,

So I will pw. Py and pw. Bat file directly in C: \ Users \ ouyang red, so use WIN + R input "python pw. Py CSDN" program can be run (i.e., copied on the clipboard CSDN password), has found that it is possible to CMD path problem

Then search data again, will be the default path CMD to modify to C: \ Users \ ouyang red \ Desktop \ MyPythonScripts (i.e., every win + R open the CMD window shows the path)

However, after the change path, WIN + R, input "python pw. Py CSDN" program still can't run,,,

The situation is the default path for the CMD have changed, but still py and bat file must be placed instead of the default path to use win + R batch execution, is there any help explain the great god, thank you

CodePudding user response:

Python pw. Py is to the execution of the current directory py files is not recommended to modify the default path of CMD, can be in pw. Bat start to add the CD command:
 CD C: \ Users \ ouyang red \ Desktop \ MyPythonScripts 
Python pw. Py CSDN

And the program execution path is best not to have any Chinese
  • Related