Title: Signature.html
Thanks to both above posts before this reply.
I'll forgo the VM route. It would really complicate things for the
users of the application having to deal with VM. Most are near
neophytes.
Nevertheless, it looks like there may be some hope here for just doing
it from w/i Win OS.
My other choice is recoding 38K lines of C code into Python. I'll pass
on that. :-) Unless there's a very good translator between languages.
Alan Gauld wrote:
"Wayne Watson" <sierra_mtnv...@sbcglobal.net> wrote
The Subject contains the interest here. Can
it be done?
A C program is compiled into a binary executable complete
with link loader. The executable is not portable across operating
systems (nor hardware architectures in most cases)
I think it this case it requires executing
the program
command line with parameters then executing it?
Yes and that can be done via the Popen class in the subprocess
module. So your python program can launch an executable and
read/write to stdout/in
Alternatively you can launch a GUI program and access it via
technologies such as COM in Windows. Other OS/Desktop
environments have other hooks - eg Applescript can often be
used on MacOS.
How dependent upon the C compiled code is
this? That is,
I would think various distributions of Linux might produce
different executable code.
No the compiled code runs (or can run) on any distribution of
Linux. The distributions vary in where they store system files,
which packages are included/installed as standard and the
admin tools they provide. But the underlying OS is essentially
the same for all of them.
The[This] too I would want to do this in Win.
Is there, in fact, some
Linux environment in Win that would allow me to test its executable?
You can run Linux on a virtual machine inside Windows. VMWare is
one route to this. Or you might be able to use cygwin to produce a
windows application running using cygwin (a set of Linux like
libraries for Windows). The formner alloows you to run the actual
Linux executable file, the latter allows you to recompile the C code
to run under Windows. Depends what suits you best.
HTH,
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
“Life is one damn thing after another."
-- Mark Twain
|
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor