473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
1 7126
abeLuna
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: https://developer.mozilla.org/en-US/...XMLHttpRequest

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

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

Similar topics

10
by: Safalra | last post by:
When a poster in a forum I frequent said they were beginning to learn HTML, I thought I should direct them to a good HTML tutorial so that they wouldn't start using <blink> and the like....
3
by: shishuda91 | last post by:
I'd like to display scrolling, word-wrapped, centered text on a blank white screen with no window borders, nothing. Just a pure white screen with big letters in the middle (in an invisible box)....
7
by: fatalserpent | last post by:
Here is the basic code (yes, I know its tiny). x = print "x =", x for m in x: print m I want to modify this so it will output to a file called 1. What I want is to have that file direct its...
7
by: brochu121 | last post by:
Does anyone know of a way to embed python scripts into html, much like you would javascript or php? I do not want to use this to connect to a database, but rather for a functional script to be...
13
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them...
2
by: Sean Hammond | last post by:
Forgive my ignorance, but I sometimes write custom dynamic web-pages using PHP, by simply embedding PHP in HTML with <?php ?tags, and renaming for example index.html to index.php and making it...
2
by: prashantkisanpatil | last post by:
Hi All, I am trying to wrap a japanese text in Python, by the following code. if len(message) 54: message = message.decode("UTF8") strlist = textwrap.wrap(message,54) After this I am...
2
by: Steven W. Orr | last post by:
Does something like that exist? TIA -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say...
1
by: lihao0129 | last post by:
The scenario is a RTF(Rich Text Format) editor where I can input text and meanwhile display 'style'd text or multimedia( i.e bold fonts, pictures, movies ) in the same box... I am currently...
1
Haitashi
by: Haitashi | last post by:
Hi guys! First off let me explain that I know it's not possible to output html in a text area and expect it to appear rendered. =) I'm trying to come up with a solution. Basically, I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.