3

I have gone through a few tutorials regarding console Python applications. I am using vim and using the Windows command prompt to run my same applications. I am moving towards GUI creation in wxPython. I am essentially trying to recreate the google finance chart, but with data from some temperature sensors.

However, whenever I run the program from the command line, the window of my sample app flashes and goes away immediately. When I ran it through IDLE, I saw that there was an error in my code. Is there a way to see errors when I run it from the command line, because I am much more comfortable with vim?

Thanks in advance!

3
  • how do you start the program on the command line, and what kind of error do you get in IDLE? also, have you considered using cygwin instead of the windows shell? Commented Jul 31, 2012 at 13:12
  • @l4mpi I just had a type, so I was calling an incorrect function. I have not used cygwin, how would that differ from regular command prompt? Commented Jul 31, 2012 at 13:30
  • 1
    cygwin gives you a linux-like environment on a windows system, meaning you could use a linux shell like bash (or zsh, or ksh, etc.), which is vastly superior to windows' cmd. Commented Jul 31, 2012 at 13:42

2 Answers 2

1

You can run the code, using commands in cmd prompt "Python.exe filename.py", as it shouldn't exit the cmd prompt upon the execution of the code.

Or you can write the program in vim and run it through IDLE.

Sign up to request clarification or add additional context in comments.

3 Comments

that sounds right. Is there a way to run it through IDLE, I have just been double clicking in windows explorer?
Well, you'll have to open the file then run it normally, it's a bit tiring solution. That's why I'd recommend the first.
Double clicking in windows explorer, asks the console to close once the execution of the program is terminated, whether smoothly or not. The better solution is to run CMD Prompt, move the working directory where your file is, and run it using the command "Python.exe filename.py". What happens after the termination. Is that the CMD gives you back the command, while all the outputs will still be there, or as large as your prompt buffer hold.
0

Telling the program to request input from the console at the end via raw_input() should cause it to pause before closing the console.

1 Comment

@MagoInvello I was more referring to the fact that I never get notified of the error in the console.

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.