I am writing a small python script where I open an existing executable (.exe) and I send a string as an argument.
I am using the subprocess.call method and I get the following error:
File "C:\Python34\lib\subprocess.py", line 537, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Python34\lib\subprocess.py", line 767, in __init__
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer
My code
import os
import subprocess
x = subprocess.call("C:\\Users\\Desktop\\Program\\Program.exe", y)
where y is a string I am passing.
I am trying to upgrade an old VB code. The original code calls the executable and passes an argument as shown below. I am trying to replicate this in Python.
Private comm As ExecCmd
Dim cmd As String
Dim app As String
Dim e As New ExecCmd
exec_1= "...\Desktop\Program.exe"
x = "Text" & Variable & " Hello" & Variable2
comm.StartApp exec_1, x 'starts the .exe file with an argument