[Pythonmac-SIG] reposting: Q: emulating os.system() on macs?

Sean Hummel sean@digitalharmony.com
Fri, 3 Dec 1999 13:24:29 -0800


Having put some thought time into this for previous projects.  I would do
the following:

1. Get the old N-Shell source.  This was a well written commercial  product
which became defunct, and the company released it to the public domain.  It
is easily expandable with plugins.  And I have found it useful in many
projects which required a command line interface.   It already does the most
common things you would expect a shell to do.
2. I'd modify the source of Nshell so that Python was embedded in it.
3. Make an os.system module for your embedded version of Python, which
allows you to send those command lines to the N-Shell command interpreter.
4. Write plugins for N-Shell which simulate your commands.

Of course this is more simplistic than I am sure the project would be, but
it may be worth your time to look into such a solution.

-----Original Message-----
From:	pythonmac-sig-admin@python.org [mailto:pythonmac-sig-admin@python.org]
On Behalf Of Giorgio Brajnik
Sent:	Thursday, December 02, 1999 5:20 AM
To:	pythonmac-sig@python.org
Subject:	[Pythonmac-SIG] reposting: Q: emulating os.system() on macs?

[this is a reposting, hoping that some Mac guru could help me]

Hi.

I'm in the process of planning to port a Python application that
is being developed on Linux to the Mac. One of the many questions I
have is how to emulate in Python/Mac something like:


def doit(infile, outfile, errfile, exefile):
    """
    execute "exefile" on "infile" and write "outfile" and "errfile"
    """
    cmd = '%s < "%s" > "%s" 2> "%s"'%(exefile, infile, outfile, errfile)
    os.system(cmd)
    return (outfile, errfile)

Any suggestion?

        Giorgio Brajnik
______________________________________________________________________
Dip. di Matematica e Informatica   | voice: +39 (432) 55.8445
Universita` di Udine               | fax:   +39 (432) 55.8499
Via delle Scienze, 206             | email: giorgio@dimi.uniud.it
Loc. Rizzi -- 33100 Udine -- ITALY | http://www.dimi.uniud.it/~giorgio
------- End of forwarded message -------

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://www.python.org/mailman/listinfo/pythonmac-sig