0

Is this possible? I yes, can anyone help me how to do it. I don't know how to use subprocess and Popen() to run my sort.bat file.

jirostatic
  • 17
  • 1
  • 3
  • 1
    Did you read `subprocess`'s [documentation](https://docs.python.org/3/library/subprocess.html) to understand how it works? – DeepSpace May 19 '16 at 10:53
  • @DeepSpace I tried reading it but I'm still confused on how to apply it to run a batch file/process. But it's okay now. I tried the code from Farhan's answer. But if you have a more comprehensive explanation of the `subprocess` and `Popen()` codes than the documentation, I would be glad to hear from you. :) – jirostatic May 19 '16 at 11:08

1 Answers1

3

You can use os.system:

import os
os.system('Path to your .bat file')
Farhan.K
  • 3,425
  • 2
  • 15
  • 26