4

I've got a short python script that will eventually edit an input file, run an executable on that input file and read the output from the executable. The problem is, I've compiled the executable through msys, and can only seem to run it from the msys window. I'm wondering if the easiest way to do this is to somehow use os.command in Python to run msys and pipe a command in, or run a script through msys, but I haven't found a way to do this.

Has anyone tried this before? How would you pipe a command into msys? Or is there a smarter way to do this that I haven't thought of?

Thanks in advance!

EDIT: Just realized that this information might help, haha . . . . I'm running Windows, msys 1.0 and Python 2.7

4
  • Thanks for the reply, agf . . . the error is "c:\path\program.exe is not a valid Win32 application". I wish I had a more helpful error message . . . Commented Sep 30, 2011 at 16:54
  • Wait! I got a better one . . . "The program can't start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem." Commented Sep 30, 2011 at 16:57
  • Perfect! Everything's running, and Python is playing nicely. I had no idea that my msys installation wasn't working quite right; I just assumed I had to run everything through its shell. Embarassing...thanks a lot, agf! Commented Sep 30, 2011 at 17:26
  • Do you have some working code that detects and runs a command using msys on Windows? it will be very useful to post it. Commented Nov 15, 2011 at 14:12

1 Answer 1

1
  1. Find where in the msys path libgcc_s_dw2-1.dll is.
  2. Find the environmental variable in MSYS that has that path in it.
  3. Add that environmental variable to Windows.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.