By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,969 Members | 2,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,969 IT Pros & Developers. It's quick & easy.

I am trying to either display scrolling/falling text or embed python output to HTML

P: 1
I am quite familiar with Python
I am new to, but OK with HTML
I have the internet and know how to research - and usually get by.

Here's what I want to do, explained as simple as possible:

I am messing with a personal project - a webpage.
All I want to do is display some text, say output from a shell while a Python program is running.

I literally want to print a sequence of strings, and have them scroll down through a textbox to simulate a terminal, or shell running a program -

so say I printed a load of print statements,
I just want to display them, one by one, on my webpage, in a designated frame or box, and have the messages scroll down through this box one by one - like a falling text effect.

It doesn't have to be python text - but I would prefer to learn how to embed a python script and display the output in a console or shell in the HTML page.

And my ultimate goal is to have a button on the webpage that executes my python script and starts the text output display sequence.

As I said, Im OK with Python, very new to HTML, and am just managing the basics with JS and CSS, so the webpage side of things needs to be explained fairly simply

If I can do it without Python that's fine - it would literally need to be a button that starts a falling text display with pre written text scrolling by -

If anyone knows how to embed python this way, I want to have a button on my HTML page that executes a python program, that shows it's output in a text box or console type frame

(or...I know that Pythons standard GUI library tkinter doesn't embed very well, but it would be amazing if I could just write a little GUI program, with a button widget and output printed to a frame - my question therefore would be, does Python have a non-standard GUI library that can be embedded into a webpage?)

Which of these would be best? It is literally just as a fun little demo I am doing, but I want future knowledge of embedding Python too
Sep 10 '18 #1
Share this Question
Share on Google+
1 Reply

P: 13
You will have to make a web service in Python that will accept requests and return those status messages to your HTML page. From the HTML page you can use JavaScript and the XmlHttpRequest class to query that Python web service and listen for updates.

Here is a link to the Mozilla Developer Network reference documentation:

I don't really know Python so I can't help you in writing the web service. But I'm sure you can figure that out.
Sep 10 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.