Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 1.17 KB

README.md

File metadata and controls

26 lines (22 loc) · 1.17 KB

PythonRunner

Star if you find it interesting

Run Bat File using Python
Important things to take note of -->

If You want to pause for result just type some extra inputs as this code wont wait for you to see output in cmd
You can also use some keys to exit the command prompt
If you are showing some output on cmd just put an input at last line of code.

For those who want to get deeper insights of Code -->

echo --> print stuff on command prompt.
on --> to show what are we outputting
& --> first performs the task on left and then the task on right
python3 --> global variable for python
-x --> version
"%~f0" --> % - Specifier
    f0 - to get the complete path of the file (python in our case)
     ~ - to remove double quotes if any
goto - to go to the defined label
:eof - end of file (predefined label)

what we are doing is

first printing python3 on cmd to run then getting the complete path for the file.
if the file is not found terminate the program (eof)
else run the script under Python