Python web app.

How to run Python as a web application from any browser

How to run Python as a web application from any browser

Have a Python application and want to run it on the web? Thinfinity® VirtualUI is a windows software virtualization solution. By adding a piece of code to your Python app source you can then run it within a web browser and access it from any OS. Run your regular desktop applications from your browser, without even having to install them on the computer! Let’s learn more about this HTML5 solution for Python apps!

How to run Python development as a web app

In order to move your Python application to the web with VirtualUI, you’ll need to add some code lines to your application.
First, we need to add an import from win32com.client:
import win32com.client

Run Python app on a browser

Then, create an object calling the Thinfinity.VirtualUI library:
self.VirtualUI = win32com.client.Dispatch(“Thinfinity.VirtualUI”)

Run Python app on a browser

And last but not least, you need to the VirtualUI.Start() method right before the mainloop() starts:
def run(self):
self.VirtualUI.Start (60)
self.tkRoot.mainloop()

Run Python app on a browser

Below you’ll find a link for a demo for VirtualUI with Python:

https://www.cybelesoft.com/support/files/DemosVUI/Python_Notepad_VirtualUI.zip
In order for the demo to work, you’ll need to install VirtualUI on the development machine where Python is installed.

Once you modify the application, you need to publish the application like this:

Run Python app on a browser

Have any questions?

Book a call today to learn more about how Thinfinity® can help your organization. We are always available to guide you and provide the best solution based on your specific needs.

4 Comments

Mariana
Reply
January 30, 2020 at 6:23 pm

Thanks, Natasha! Let me know if you need any help with it: [email protected]

Natasha Bieber
Reply
January 29, 2020 at 11:50 am

Thanks for sharing this tutorial. It’s really useful for web app users python developers. Appreciate your hard work.

Mariana
Reply
December 4, 2019 at 1:15 pm

Dear Alota,
The article includes a link to a demo:
https://www.cybelesoft.com/support/files/DemosVUI/Python_Notepad_VirtualUI.zip
Did you try it?
Can you please give me some details about your experience with it?
My email is: [email protected]
Thanks!

alota
Reply
December 3, 2019 at 12:01 am

Hello Madame. I really love this article. But I face difficulty in understanding how to modify my script. I use python as my programming language . I have a desktop application which I really love to put as a commercial service on a web page. Please a simple example of a script will be of great help. Thanks

Add Comment

Thinfinity_logo

Get a Demo

Experience how Universal ZTNA with Thinfinity® integrates with VDI and DaaS for unmatched security and flexibility.

Blogs you might be interested in

<span>Application Modernization</span>, <span>Developer</span>, <span>HTML5 Conversion</span>, <span>Independent software Vendor (ISV)</span>, <span>Python</span>, <span>Secure Application Delivery</span>, <span>Thinfinity VirtualUI</span>