试试这个:from subprocess import Popen, check_output, check_call, PIPE, call
get_input = input("What Should I do?")
if get_input.strip().lower() == "run":
your_exe_file_address = r'"C:\Users\you\Desktop\my_file.exe"' # example
your_module_address = r'"C:\Users\you\Desktop\test.m"' # example
your_command = "call"
process = Popen([your_exe_file_address, your_command, your_module_address], stdout=PIPE, stderr=PIPE, shell=True)
stdout, stderr = process.communicate()
# < Other Ways >
# process = check_output([your_exe_file_address, your_command, your_module_address])
# process = check_call([your_exe_file_address, your_command, your_module_address], shell=True)
# process = call([your_exe_file_address, your_command, your_module_address], s