summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergiusz Bazański <q3k@q3k.org>2012-11-11 13:25:28 +0100
committerSergiusz Bazański <q3k@q3k.org>2012-11-11 13:25:28 +0100
commit318fe0a9094b2624761d2f6f8de8f491305145bc (patch)
treebfd6c74cefa6aed2d59aaa88829c8a71431f13d9
parent6f6dd4fe4c38a53978736fae07525f30a4a9c208 (diff)
downloadlaserz_und_stuff-318fe0a9094b2624761d2f6f8de8f491305145bc.tar.gz
laserz_und_stuff-318fe0a9094b2624761d2f6f8de8f491305145bc.tar.bz2
laserz_und_stuff-318fe0a9094b2624761d2f6f8de8f491305145bc.zip
Sample view.
-rw-r--r--Lasers_und_stuff/main.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Lasers_und_stuff/main.py b/Lasers_und_stuff/main.py
index 0b61c0d..4869d96 100644
--- a/Lasers_und_stuff/main.py
+++ b/Lasers_und_stuff/main.py
@@ -18,6 +18,10 @@ app = flask.Flask(__name__)
app.debug = True
pygame.init()
+@app.route("/")
+def root():
+ return "COCKS"
+
def main():
#create the screen
window = pygame.display.set_mode((800, 600))
@@ -40,12 +44,13 @@ def main():
gunpoint = Gunpoint((5, 4), (200, 4), (5, 210))
- while True:
+ keep_running = True
+ while keep_running:
screen.draw_surface(cannon)
for event in pygame.event.get():
if event.type == pygame.QUIT:
- sys.exit(0)
+ keep_running = False
elif event.type == KEYUP :
cannon.send_data()
if event.key == K_SPACE:
@@ -84,7 +89,8 @@ def main():
elif event.type == MOUSEBUTTONUP:
screen.change_color()
-
+ print "Pygame thread exited."
+ os.kill(os.getpid(), signal.SIGINT)