How can I create a ...
 
Share:
Notifications
Clear all

How can I create a BAT/CMD file for python script?


Neha
 Neha
(@asha)
Member Admin
Joined: 4 years ago
Posts: 31
Topic starter  

How can I create a simple BAT/CMD (Batch File) file that will run my python script located at C:\somescript.py?

So that I can execute Python script using BAT/CMD file directly.


Quote
Topic Tags
myTechMint
(@mytechmint)
Member Moderator
Joined: 4 years ago
Posts: 52
 

c:\python27\python.exe c:\somescript.py %*

For Example:

cls
SET script_path=%~dp0
cd script_path
python "%script_path%test-script.py" %*
pause

Neha liked
ReplyQuote