[Tutor] Executing a C Program from RH Linux in Python for Win
A.T.Hofkamp
a.t.hofkamp at tue.nl
Fri Mar 20 15:32:44 CET 2009
Wayne Watson wrote:
> Yes, good, but I tried
> myProg = call([r"C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]),
> and get exactly the same results.
So the next step is to find out what is wrong.
In other words, experiment with the problem to get an understanding what is
not working. Once you get that, you can start looking for a way to solve it.
Some suggestions for possible experiments:
Are you sure the program is not already finished? (ie it runs the program, and
after finishing it gives an error for some reason?)
What does Windows think of it when you run it without Python (ie directly from
the OS, eg using a 'cmd' window (or whatever it is called nowadays, my last
Win* experience was with W95))?
(The error looks like an OS error, not a Python error. By trying it without
Python, you can decide whether you need to convince your OS to run the program
or you whether need to convince Python.)
Possibly a stupid suggestion, don't you need to add '.exe' at the end?
(I am pretty much clueless with Windows, so maybe this is nonense.)
Alternatively, try executing a different program that you know to be working
at Windows.
(The python.exe would be one such program, but it may be confusing to run
several python programs at the same time.)
Last but not least, what error do you get when you try running something that
does not exist?
(Do you get the same error, or do you get a different one? If the latter, you
know Python gives the path correctly to Windows.)
What happens if you give it a non-executable file? (just giving wild
suggestions for experiments you can do to get more understanding of why it is
refusing to run the file.)
Albert
More information about the Tutor
mailing list