September 9th, 2005, 01:53 PM
-
Help, extra newb question
i have done some really simple stoff with python
and i will right a program but for some reason when i run it, it doesnt run, it like flashes and it is gone...
so i thought it would do that if i didnt put anything in for the user to do. like press a button to exit or do anything, but of course i have something for the user to do.
i dont know why it keeps doing this, do i make any sense?
plz help!
September 9th, 2005, 02:31 PM
-
plzzzz
September 9th, 2005, 02:34 PM
-
Hi!
We can't really help you if you don't show your code 
You said "it flashes" so I guess it's some kind of GUI stuff. Tkinter?
Maybe you forgot root.mainloop()?
Regards, mawe
September 9th, 2005, 04:18 PM
-
Maybe he isn't using a GUI at all, instead he's using the console. If this is so then he has an error occuring at startup of the program and it instantly closes. Do this to find out what the error is:
At the top of all of your code, type this:
Then indent all of your programs code by one time (Tab key once) that is below this.
Then add at the very bottom, but don't indent this, keep it as far as left as it can go, so it is lined up with the try::
Code:
except Exception, inst:
print inst
time.sleep(1000)
September 10th, 2005, 07:05 PM
-
At the endof your program add:
Code:
# console wait for keypress
raw_input('Press Enter')
September 11th, 2005, 04:58 AM
-
If it is flashing up a command line box, then it is probably throwing an exception. Run it from the command line instead of double-clicking on the icon and you will be able to see what the exception is and fix it.
Dave - The Developers' Coach
September 11th, 2005, 05:49 AM
-
run it from IDLE to see the exception and anyways it only can be a error if it flashes
Those people who think they know everything are a great annoyance to those of us who do.
September 14th, 2005, 01:46 PM
-
Originally Posted by Dietrich
At the endof your program add:
Code:
# console wait for keypress
raw_input('Press Enter')
ye thatis what i got at the end of it.
sorry i forgot the code, and thanks for the suggestions, ill try
if what you guys said doesnt fix it ill show the code
September 14th, 2005, 02:09 PM
-
September 14th, 2005, 02:10 PM
-
September 14th, 2005, 02:10 PM
-
oopse i said it twice, lol
September 14th, 2005, 02:32 PM
-
ok i got another question:
what does, cant assign to operator mean?
September 15th, 2005, 12:26 PM
-
Can you show us the section of code the error is occuring with? It's very hard to speak of these things in general terms.
Oh, and if you haven't already, you would do well to read the New Posters thread, including the articles that the lower messages link to. They have some excellent advice on how to get the most out of the fora.