Python Forum
batch file for running python scipt in Windows shell
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
batch file for running python scipt in Windows shell
#2
The @ in a batch file is suppressing the echoing of the command.
Often in batch files the following pattern is used, to switch the echoing of commands globally off:
@echo off
py.exe is the program, which finds the latest Python Interpreter on well-known paths.
C:\yourpath\PythonScript.py is the program itself.
The %* is for arguments.
google Wrote:%* expands to the complete list of arguments passed to the script. You typically use it when you want to call some other program or script and pass the same arguments that were passed to your script. The %* modifier is a unique modifier that represents all arguments passed in a batch file.

The command pause will be executed after the python program has been finished. The command pause waits for a key press.
This is often used to see debug output from a broken program. If it was not run direct in a terminal, the new terminal will instantly close, and you've no time to read the Exceptions.
tester_V likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: batch file for running python scipt in Windows shell - by DeaD_EyE - Jan-21-2022, 10:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error "cannot identify image file" part way through running hatflyer 0 720 Nov-02-2023, 11:45 PM
Last Post: hatflyer
  Help creating shell scrip for python file marciokoko 10 1,440 Sep-16-2023, 09:46 PM
Last Post: snippsat
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,398 Jun-29-2023, 11:57 AM
Last Post: gologica
  Python script running under windows over nssm.exe JaroslavZ 0 743 May-12-2023, 09:22 AM
Last Post: JaroslavZ
  Launch Python IDLE Shell from terminal Pavel_47 5 1,296 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Web project and running a .py file emont 0 672 Dec-11-2022, 11:15 PM
Last Post: emont
  Running A Parser In VSCode - And Write The Results Into A Csv-File apollo 5 4,714 Jan-14-2021, 08:58 PM
Last Post: snippsat
  Sound Approach for Running a Shell Command? matt_the_hall 8 3,431 Dec-14-2020, 02:52 PM
Last Post: matt_the_hall
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 4,720 Nov-30-2020, 03:24 PM
Last Post: gacg1
  How to make a Python program run in a dos shell (cmd) Pedroski55 2 2,360 Nov-09-2020, 10:17 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020