Doesn't MS-Windows likes Python ? (or: why more than 20 sec delaywhen running a program from Python)

Jim Carlock jcarlock at MUNGED.microcosmotalk.com
Thu Dec 24 08:59:05 EST 2009


"Stef Mientki" wrote...
:
: I've an AutoIt program that set some switches in the LAN settings.
: 
: When I launch the AutoIt executable, the settings are changed
: immediately.
: 
: When I launch the AutoIt executable from python (which is the
: intention), it hangs for about 20 seconds, before any action
: appears on the screen.
: 
: Analyzing the script, shows that it hangs on the next 2 lines:
: 
:   Run ( "control.exe ncpa.cpl" )
:   WinWait( "Network Connections")
: 
: Transfering the Run command to Python, it hangs on the next
: subprocess call
:  subprocess.call ( [ r"control.exe",  "ncpa.cpl" ])
: 
: Does anyone have a clue, why starting a process takes 20 seconds
: longer when ran from Python ?
: 
: And even more important, is there a work around ?

I know this is almost two months late.

Control.exe is the program which starts up the control panel. The
easiest thing to try is to use a fully qualified path to start it.

"%systemroot%\system32\control.exe" ncpa.cpl

The above should help with W95 to Windows XP. For 64-bit versions
control.exe might reside in a system64 folder.

Did you ever figure out the solution to the problem?

-- 
Jim Carlock




More information about the Python-list mailing list