473,581 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

executing a command

Hi to all,
I need to run a program from inside python (substantially, algorithmic
batch processing).
I'm on mac osx 10.3.8 with python 2.3 framework and macpython.

Trying to use exec*, I checked references, Brueck & Tanner, and then
grab this code from effbot:
program = "python"
def run(program, *args): os.execvp(progr am, (program,) + args)
print "ok"
run("python", "/Users/apple/Desktop/prova.py")
Traceback (most recent call last):
File "<pyshell#5 0>", line 1, in -toplevel-
run("python", "/Users/apple/Desktop/prova.py")
File "<pyshell#4 9>", line 2, in run
os.execvp(progr am, (program,) + args)
File
"/System/Library/Frameworks/Python.framewor k/Versions/2.3/lib/
python2.3/os.py", line 336, in execvp
_execvpe(file, args)
File
"/System/Library/Frameworks/Python.framewor k/Versions/2.3/lib/
python2.3/os.py", line 374, in _execvpe
func(fullname, *argrest)
OSError: [Errno 45] Operation not supported

This OSError seems to be consistend with all exec family. What does it
mean and how to use exec?

I also tried with. os.system. It works if I invoke python, but it fails
(in a way I don't know) when I invoke other programs.

For example:
command = "python /Users/apple/Desktop/test.py" os.system(comma nd) 0
(test.py write a string in a file. It works)

But with lilypond or with latex I have no output (and in fact it
doesn't give 0 as result):
command = "lilypond /Users/apple/Desktop/test.ly"
os.system(comma nd) 32512 command = "latex /Users/apple/Desktop/test.tex"
os.system(comma nd)

32512

Any help is much appreciated

Thanks a lot

-a-

Jul 19 '05 #1
0 1391

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10906
by: Falk Schneider | last post by:
I wrote a PHP shell script under Linux which puts all existing PS-Files within a directory into a list and should then start a single Ghostview window for each file. Sounds simple, but it's not: The following code provides for about half of the functionality I wanted: ==============code starts $bla = array(); foreach ($filelist as $file)
9
6674
by: Jean-Marc Molina | last post by:
Hello, I can't find a way to execute a Windows application, whose directory path contains blank spaces, from a PHP script. I also wonder if the problem happens under Linux and other OS. Working dir : "C:\test copy" "copy.php" PHP script : <?php
0
2255
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure , msaccess hangs. The whole call to the procedure is running fine, but immediatly after this msaccess hangs, when the focus goes back to the calling form ? Has anyone any idea what i can test or look...
0
1944
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is inside a package, the invocation will fail with a "Module not found" error. This PEP is aimed at fixing that :) Cheers, Nick.
15
2576
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a "Module not found" error. This PEP aims to fix that for Python 2.5. Previously, posting of a draft version of the PEP to python-dev and python-list didn't actually generate any responses. I'm not...
18
2237
by: Brad Pears | last post by:
Can someone give me some sample code on how one would go about executing a command line "command" from within an ASP form? We need to run an application called GnuPG which allows us to encrypt an email. Preferably some documentation directly on this would be good but any other docuemtnation on executing a command line "command" would be...
15
11532
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to MSACCESS.EXE, tries them all, takes the first one it finds, and dies if none is found. Seems to me like at some time or another I was able to clone this...
0
6768
by: NOSPAM | last post by:
Guys, I get the 'There was an error executing the command' error message. I an using win xp & Access 2002. I created a database using the MS Access template 'Order Entry' I have entered about 97 customer enries so far.
1
3140
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure , msaccess hangs. The whole call to the procedure is running fine, but immediatly after this msaccess hangs, when the focus goes back to the calling form ? Has anyone any idea what i can test or look...
4
8757
by: Justine | last post by:
Hi All, How can v execute DOS command while executing Console Application written using C#, like cls,dir commnads. Thanz in Advance, Justine
0
7789
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8144
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8301
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8169
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5361
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3803
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3820
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1400
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.