Pass variable from python script to C program(command line argument) -



Pass variable from python script to C program(command line argument) -

i here issue : have gui (wxpython), has spinctrl, output of spinctrl must sent c file, take command line argument, whenever execute c file using subprocess accepts value gui spinctrl value must sent instead of manual typing.

my code is:

ps = "password" var1 = self.sc1.getvalue() var2 = self.sc2.getvalue() subprocess.call(['echo xsxsxs | sudo "./license.exe"', str(ps), str(var1), str(var2)],shell = true)

whenever run script doesnot show output/error :(

if remove echo xsxsxs| sudo line 4 , execute show error: "you must root user","invalid password", "segmentation fault".

whenever utilize shell=true subprocess.popen (or 1 of convenience wrappers), should pass string way type in shell, not list.

from docs:

if shell true, recommended pass args string rather sequence.

python c wxpython subprocess wxwidgets

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -