Hello,
Does someone already had ths problem ? os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\os.py", line 565, in spawnl
return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument
Regards
Salvatore 6 5517
The backslashes in your path are being interpreted
as escape characters (e.g. \n is a newline).
Try instead:
os.spawnl(os.P_NOWAIT,r'c:\windows\notepad.exe')
or
os.spawnl(os.P_NOWAIT,'c:\\windows\\notepad.exe')
-Larry Bates
Salvatore wrote: Hello,
Does someone already had ths problem ?
os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe' )
Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\lib\os.py", line 565, in spawnl return spawnv(mode, file, args) OSError: [Errno 22] Invalid argument
Regards
Salvatore
The backslashes in your path are being interpreted
as escape characters (e.g. \n is a newline).
Try instead:
os.spawnl(os.P_NOWAIT,r'c:\windows\notepad.exe')
or
os.spawnl(os.P_NOWAIT,'c:\\windows\\notepad.exe')
-Larry Bates
Salvatore wrote: Hello,
Does someone already had ths problem ?
os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe' )
Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\lib\os.py", line 565, in spawnl return spawnv(mode, file, args) OSError: [Errno 22] Invalid argument
Regards
Salvatore
Salvatore wrote: Does someone already had ths problem ?
os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe') Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\lib\os.py", line 565, in spawnl return spawnv(mode, file, args) OSError: [Errno 22] Invalid argument
that string doesn't contain what you think: print "c:\windows\notepad.exe"
c:\windows
otepad.exe
you can use "raw" string literals to get around this:
os.spawnl(os.P_NOWAIT, r'c:\windows\notepad.exe')
more here: http://docs.python.org/tut/node5.htm...00000000000000
</F>
Salvatore wrote: Does someone already had ths problem ?
os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe') Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\lib\os.py", line 565, in spawnl return spawnv(mode, file, args) OSError: [Errno 22] Invalid argument
that string doesn't contain what you think: print "c:\windows\notepad.exe"
c:\windows
otepad.exe
you can use "raw" string literals to get around this:
os.spawnl(os.P_NOWAIT, r'c:\windows\notepad.exe')
more here: http://docs.python.org/tut/node5.htm...00000000000000
</F>
I have found the judicious use of os.path.normpath(path) to be quite
useful as well.
Bob
I have found the judicious use of os.path.normpath(path) to be quite
useful as well.
Bob This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: nushin |
last post by:
Greetings,
I am running RedHat 7.3 and trying to spawn a hello.py program from
hello_driver.py by using spawn*( ) API, as a P_NOWAIT :
os.spawnv(os.P_NOWAIT,'/usr/bin/python',('python hello.py...
|
by: nushin |
last post by:
Try to launch a test program that prints hello world for a minute or
so using, spawnv( ) or spawnl( ). Check to see the process state code
that the program is running. I am using RedHat Linux 7.3...
|
by: Steve Homer |
last post by:
Hi everyone,
Appologies if this is the wrong forum for this post.
I am a little confused by the code below and any help would be much
appreciated.
import os,signal,time,sys
class Tzap:
|
by: Jonathan Ellis |
last post by:
When I start a (py2exe'd python) program from another with spawnl on
windows, the program name is omitted from its argv. Is there another
way to introspect this big of information? It's ugly...
|
by: deko |
last post by:
I use this convention frequently:
Exit_Here:
Exit Sub
HandleErr:
Select Case Err.Number
Case 3163
Resume Next
Case 3376
Resume Next
|
by: p |
last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also
have Crystal 9 pro on my development machine. The web app runs fine on my
dev machine but am having problems deploying....
|
by: Salvatore |
last post by:
Hello,
Does someone already had ths problem ?
>>> os.spawnl(os.P_NOWAIT,'c:\windows\notepad.exe')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File...
|
by: Tor Erik |
last post by:
Hi,
I need to start a program in a new cmd-window. To do this I need to
execute: start
With os.system this is straight-forward.
But I need to do it with spawnl and P_NOWAIT. I.e,...
|
by: naima.mans |
last post by:
hello,
I run a python cgi script under Apache...
and while the script is running i want to display a "please wait"
message until the script finish.
I have tried to do this but the "please...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |