Python Forum

Full Version: [split] calling external exe with subprocess (maybe)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
import subprocess

# runExe takes two parameters and runs CrackMe.exe.  It will return the result of CrackMe.exe as a string
username=str()
# username: string
pin=int()
# pin: int
# return: string
def runExe(username, pin):
    out = subprocess.check_output(["CrackMe.exe", username, str(pin)], shell=True)
    out = str(out, 'utf-8')
    out = out.strip()
    return out

# Example of how runExe is used (replace this with your solution)
output = runExe("[email protected]", 1000)
print(output)
what is your question?
pin is always 0 and username is always empty.