-1

I'm kinda new to Python and I need help. So basically I want to make a function that will run a specific file (.vbs, or some app). How do I do that? Thanks.

Łukasz Ślusarczyk
  • 1,775
  • 11
  • 20
Rales
  • 1
  • 3
    Does this answer your question? [Calling an external command from Python](https://stackoverflow.com/questions/89228/calling-an-external-command-from-python) – Łukasz Ślusarczyk Mar 03 '20 at 21:50
  • 1
    Hi! Thanks for the first question. Please watch out grammar and check if your question isn't already answered on SO. Almost all common questions are already answered :) – Łukasz Ślusarczyk Mar 03 '20 at 21:51
  • Here is the [`subprocess` doc](https://docs.python.org/3/library/subprocess.html) – tdelaney Mar 03 '20 at 22:03

1 Answers1

3

One way of doing it:

import os
os.system("C:/path/to/your/file.exe") 

Another:

from subprocess import call
call(["python", "C:/path/to/your/file.exe"])
Hayden Eastwood
  • 928
  • 2
  • 10
  • 20