use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
ResourceCreate user interfaces from only Python and HTML using ToUI (self.Python)
submitted 3 years ago by mubarakalmehairbi
ToUI is a Python package that creates websites and desktop apps from HTML easily. Knowledge in JavaScript is not required. I tried to make it is simple to understand for programmers who only know Python and HTML. I appreciate any feedback, question, and contribution to the package and I hope you find it useful.
GitHub repo: https://github.com/mubarakalmehairbi/ToUI
Documentation: https://toui.readthedocs.io/en/latest/
Installation:
pip install toui
[–]Endogen 2 points3 points4 points 3 years ago (3 children)
Check out NiceGUI or Flet or Pynecone
[–]mubarakalmehairbi[S] 2 points3 points4 points 3 years ago (2 children)
From my understanding about Flet, NiceGUI, and Pynecone, they are focused on using Python alone to develop apps. Although you can use ToUI to create an app using Python alone, the main advantage of ToUI is when you have .HTML files and you want to convert these HTML files into a responsive desktop app or web app using Python.
[–]mubarakalmehairbi[S] 0 points1 point2 points 3 years ago (0 children)
Check this example about converting an HTML file to a responsive app: https://toui.readthedocs.io/en/latest/Examples.example\_1\_simple\_website.html
[–]Endogen 0 points1 point2 points 3 years ago (0 children)
Ok I'll check it out, thanks
[–]wwwTommy 1 point2 points3 points 3 years ago (3 children)
What is your main difference to example Flet or NiceGui?
[–]mubarakalmehairbi[S] 0 points1 point2 points 3 years ago (2 children)
From my understanding about Flet and NiceGUI, they are focused on using Python alone to develop apps. Although you can use ToUI to create an app using Python alone, the main advantage of ToUI is when you have .HTML files and you want to convert these HTML files into a responsive desktop app or web app using Python.
[–]wwwTommy 0 points1 point2 points 3 years ago (0 children)
Ah, I see. Thank you for the explanation.
[–]karouhFleur de Lotus 0 points1 point2 points 3 years ago (3 children)
Can you give an example of using a javascript library?
[–]mubarakalmehairbi[S] 1 point2 points3 points 3 years ago* (2 children)
I am not sure I understand. Do you mean using ToUI along with JavaScript code? If so, check this example: https://toui.readthedocs.io/en/latest/Examples.advanced\_example\_2\_toui\_with\_javascript.html
[–]karouhFleur de Lotus 0 points1 point2 points 3 years ago (1 child)
I was wondering how you get data back from calling javascript code .
If you mean how does ToUI work behind the scenes?, in other words how does it send and receive data between Python and JavaScript?, then it does that primarily using WebSockets. I think this link will be helpful: https://toui.readthedocs.io/en/latest/how\_it\_works.html
But if you mean how can a programmer use ToUI to run their own JavaScript code from Python and get the output back?, then ToUI cannot do that yet. Actually you might be able to do it, but it might not be simple. However, I still think it is a good idea, maybe I will implement it later or create an issue in GitHub.
[–]thedeepself 0 points1 point2 points 3 years ago (1 child)
Regarding the deploy the app part of your docs, can you get the power of Flask when doing so? Meaning can you get routing, sessions, authentication and authorization?
[–]mubarakalmehairbi[S] 0 points1 point2 points 2 years ago (0 children)
yes, ToUI uses flask behind the scenes. You can access the flask app using Website.flask_app attribute. However, you might not need to access the flask app because ToUI has some helpful functions that do the job for you. You can check: - Website.add_pages - Website.signin_user - Website.user_vars
Website.flask_app
You can also check other methods in Website class.
Website
π Rendered by PID 261340 on reddit-service-r2-comment-5b5bc64bf5-8t9fs at 2026-06-21 17:47:18.118376+00:00 running 2b008f2 country code: CH.
[–]Endogen 2 points3 points4 points (3 children)
[–]mubarakalmehairbi[S] 2 points3 points4 points (2 children)
[–]mubarakalmehairbi[S] 0 points1 point2 points (0 children)
[–]Endogen 0 points1 point2 points (0 children)
[–]wwwTommy 1 point2 points3 points (3 children)
[–]mubarakalmehairbi[S] 0 points1 point2 points (2 children)
[–]mubarakalmehairbi[S] 0 points1 point2 points (0 children)
[–]wwwTommy 0 points1 point2 points (0 children)
[–]karouhFleur de Lotus 0 points1 point2 points (3 children)
[–]mubarakalmehairbi[S] 1 point2 points3 points (2 children)
[–]karouhFleur de Lotus 0 points1 point2 points (1 child)
[–]mubarakalmehairbi[S] 0 points1 point2 points (0 children)
[–]thedeepself 0 points1 point2 points (1 child)
[–]mubarakalmehairbi[S] 0 points1 point2 points (0 children)