notepad ++ there is a space problem shortcuts to run python program directory

usually

cmd / k (the path python.exe file) " $ (FULL_CURRENT_PATH) " & & EXIT PAUSE

Ok, path, there is not the same spaces , such as me this: D: \ Python \ Python 3.6.8 ,

 

My Python 3.6.8 folder is eaten. . . They are wrong spaces. . .

Here you can go and change the folder name, and change the environment variables, but dos window will open when an error such as the implementation of pip python command.

Here fiddle for a long time become so ok

cmd /k D:&cd \Python\Python 3.6.8\&python "$(FULL_CURRENT_PATH)"&PAUSE&EXIT

Explanation:

  • cmd: Open a command prompt program
  • / K: behind the implementation of the command, which is equivalent to copy the contents back to the command prompt in execution
  • D :: open D drive
  • cd: Open the file path python.exe
  • python: python command execution
  • $ (FULL_CURRENT_PATH): Notepad ++ macro definitions, get the current file path in cmd in the need to use double quotes to enclose the path.
  • &: Connecting a plurality of commands, x & y & z execution means to x, and then execute y, z and then perform
  • pause, exit to the cmd command, refer to pause, exit


It means that the entire command, open cmd, execution python.exe, run the current file, run the end of the pause, press any key to exit cmd.

Guess you like

Origin www.cnblogs.com/zhongweizi/p/11626984.html