from gasp import *

begin_graphics()

Circle((200, 200), 60)
Line((100, 400), (580, 200))
Box((400, 350), 120, 100)

update_when('key_pressed')
end_graphics()

Recommended Answers

All 5 Replies

Sorry for no message above.
When I run this code in my IDE I get nothing. The program is running when I kill it but it doesn't show anything at all. I don't know what to do. Any help is appreciated.

Comment the Circle and Box lines and see if you get a line. Then figure out why only Line() works.

from gasp import *
 
begin_graphics()
     
#Circle((200, 200), 60)
Line((100, 400), (580, 200))
#Box((400, 350), 120, 100)
     
update_when('key_pressed')
end_graphics()

Well when I was doing it nothing was showing at all. But I'll try your method. Thanks!

'when running my IDE' -> usually bad idea to run tests (only) from IDE

Configure a text editor (like context) to launch real Python session or use command line to run the code, or insert at end input statement and double click the file (usually graphics stuff enters in mainloop and does not disappear so quickly anyway).

Oh, thanks for your help guys. Yeah I tried running through gedit and terminal and it worked. Appreciate the help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.