how to pass argument to autoIT script from python script -
in python scripting, need pass command line arguments autoit script. because in autoit script getting command line arguments , processing it. below autoit script using command line arguments , working fine:
#include <array.au3> #include <winapishpath.au3> local $acmdline = _winapi_commandlinetoargv($cmdlineraw) _arraydisplay($acmdline)
now using python script need pass command line arguments above autoit script.
i tried using in python script:
import os args = ("test","abc") os.execv("test.au3",args)
but giving exception.
this should work you.
in autoit script, put piece of code in
autoit's variable $cmdline contains parameters provided. , variable $par (feel free change name) storing parameter later use.
$par = '' if $cmdline[0] > 0 if $cmdline[1] <> @scriptname $par = $cmdline[1] ;now, can use variable $par in script. endif endif
put in python script
parameter parameter want pass
os.system("location/to/autoit/file.exe "+parameter )
i hope fixed issue.
Comments
Post a Comment