Can python programs with GUIs (such as Tkinter) be embedded into web pages?

I have looked into CGI programming before, but despite a search, I have found no books relating how to do this with python. Is it possible? Can anyone recommend a good book?

If not, what would you recommend as the best language to go with? I just want something easy for making very simple moving graphical displays on a web page. (E.g., a reader holds down a button and smiley faces start to appear on the screen.) It needs to be able to record what's happening though ("person A pressed button B"), so Flash is out.

Recommended Answers

All 5 Replies

I know that you can use javascript to call python functions/scripts. said functions can return data which you can use in your html Interface.

It would be easier and nicer to be able to use python without the user having to have it installed.

I'm not too sure off-hand how to go about doing it but i'm sure a quick google will help you.

Yeah, I guess I've been avoiding that a bit since I've been hoping someone will know of a way to do it without resorting to learning Javascript... oh well, nothing like learning a new language, eh?

Javascript can be nice, but it can also be a bit of a mystery.

all you need to know to get started is this line:

this is the easiest way to debug your script...

There are hundreds of GREAT javascript tutorials out there... maybe there's one that shows how to make function calls to python :) , so you can skip having to 'learn' the language ;)


Member Avatar

you can count user presses in flash using actionscript 3.0 wich is slightly different to 2.0

If you mean "embedded into web pages" ala PHP or ASP, I could recommend Spyce ( ).

If you mean "embedded into web pages" ala Javascript or Flash, the answer is generally no.

But be aware that Silverlight, being .NET driven, is scriptable via IronPython, so it is a qualified yes.

Be a part of the DaniWeb community

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