problem with "os.spawnle(os.P_NOWAIT,'C:\info.exe')"

M

muttu2244

hi all

i tried running a exe file info.exe from the spawnle cmd, its running
fine from the interactive mode, but when i try to run the same info.exe
file from a python file, its giving me the following error:

##############################################################
Traceback (most recent call last):
File "C:\Documents and Settings\shivayogimath_dc\Desktop\network.py",
line 56,
in ?

os.spawnle(os.P_NOWAIT,'C:\info.exe')

File "C:\Python23\Lib\site-packages\wmi.py", line 263, in __getattr__
raise AttributeError, attribute
AttributeError: spawnle
################################################################

Could u please help in removing this error.
thanks for the help

regards
 
F

Fredrik Lundh

(e-mail address removed) write;
i tried running a exe file info.exe from the spawnle cmd, its running
fine from the interactive mode, but when i try to run the same info.exe
file from a python file, its giving me the following error:

##############################################################
Traceback (most recent call last):
File "C:\Documents and Settings\shivayogimath_dc\Desktop\network.py",
line 56,
in ?

os.spawnle(os.P_NOWAIT,'C:\info.exe')

File "C:\Python23\Lib\site-packages\wmi.py", line 263, in __getattr__
raise AttributeError, attribute
AttributeError: spawnle
################################################################

Could u please help in removing this error.

if "os.spawnle" gives you an attribute error in a module that's installed under
site-packages, it's likely that you've overwritten the name "os" in your code.

as an emergeny fix, add "import os" to the line just before os.spawnle.

(if you're lucky, this will break the code that overwrote the "os" name, so
you can fix that...)

</F>
 
M

muttu2244

Ya Thanks Fredrik,

i had overwritten the os in my code indeed, now its working fine.

thanks a lot for that
regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top