N
N
Nikolai Ignatiev2015-04-25 23:43:39
JavaScript
Nikolai Ignatiev, 2015-04-25 23:43:39

How to handle mouse events in flask application?

Good afternoon, dear experts !
I study python in full-time courses. There is an understanding of the basics, I try to consolidate everything I study with practical tasks in my repository. As a study project with a colleague, we chose the development of a card browser game using the Flask framework .
We have a prototype (a thumbnail of the pages, a verbal description of the logic). I don't understand how you can handle user clicks in certain fields and perform certain actions (dealing cards, moving them, interacting with opponent's cards) using python on the server side.

I would be very grateful for a detailed answer.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-04-25
@cyb3rD

You can't do it on the server side.
There is a concept of client-server architecture. You are right for it, because the flask is a web framework.
On the client (html/css/js/flash/silverlight/java-applet/schockwave/...) you draw maps and catch all those clicks, moves, etc. And depending on your program logic, at some point form a specific request to the server. The server receives the data and processes it in a certain way: recalculates, checks, enters into the database ... and issues a response to the client. And so in a circle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question