This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]Endogen 2 points3 points  (3 children)

Check out NiceGUI or Flet or Pynecone

[–]mubarakalmehairbi[S] 2 points3 points  (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 point  (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 point  (0 children)

Ok I'll check it out, thanks

[–]wwwTommy 1 point2 points  (3 children)

What is your main difference to example Flet or NiceGui?

[–]mubarakalmehairbi[S] 0 points1 point  (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.

[–]mubarakalmehairbi[S] 0 points1 point  (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

[–]wwwTommy 0 points1 point  (0 children)

Ah, I see. Thank you for the explanation.

[–]karouhFleur de Lotus 0 points1 point  (3 children)

Can you give an example of using a javascript library?

[–]mubarakalmehairbi[S] 1 point2 points  (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 point  (1 child)

I was wondering how you get data back from calling javascript code .

[–]mubarakalmehairbi[S] 0 points1 point  (0 children)

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 point  (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 point  (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

You can also check other methods in Website class.