Fast, simple and thread-safe HTML/CSS/Python GUI framework


Dynamic JavaScript Libraries

Every Javascript Library turns into a Python module.

Easy to Distribute

You can easily distribute your application to users who has no Python binaries on their system.

Thread-Safe GUI

It keeps code quite simple.





Code



Sample 1: Working with requests module

index.html: script tag for import
 <script type="text/python" import="module_a" call="main_func"></script>

module_a.py: Run code in the background thread
import sys
import plynth
import plynth.js as js
import requests

def main_func():
    button = js.document.getElementById("a_button")
    button.onclick = start_fetch

@plynth.background
def start_fetch():
    r = requests.get("https://www.plynth.net/sample.json")
    print(r.text)



Sample 2: Calculator using Vue.js

import sys
import plynth
import plynth.js as js

class VueApp:
    def __init__(self):
        self.vue = js.Vue(
            dict(
                el="#root",
                data=dict(
                    mainResultText="0",
                    subDisplayText=""
                ),
                methods={
                    "click_number": self.click_number,
                    "click_operator": self.click_operator,
                }
            )
        )
    def click_operator(self, e):
        #
    def click_number(self, e):
        #




Videos
📁 More Videos