28
loading...
This website collects cookies to deliver better user experience
pip install Eel
└── Folder
├── templates
| ├── index.html
| ├── main.js
| └── style.css
└── main.py
import eel
# name of folder where the html, css, js, image files are located
eel.init('templates')
@eel.expose
def demo(x):
return x**2
# 1000 is width of window and 600 is the height
eel.start('index.html', size=(1000, 600))
function compute() {
var data = document.getElementById("data").value
eel.demo(data)(setValue) // call the demo function which we have created in the main.py file
}
function setValue(res) {
document.getElementById("abc").src = res
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sample</title>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="/eel.js"></script
<script type="text/javascript" src="main.js"></script>
</head>
<body>
<!--
have to call compute() from here for example when user clicks any button or something like that.
-->
</body>
</html>
<https://github.com/ChrisKnott/Eel>
pip install tkdesigner
For complete procedure do watch this video on youtube from Parth Jadhav
https://github.com/ParthJadhav/Tkinter-Designer
pip install pywebview
import webview
if __name__ == '__main__':
window = webview.create_window('Load HTML Example', 'index.html')
webview.start(window)
https://github.com/r0x0r/pywebview/
pip install PyQt5Designer
designer
in your command prompt and designer.exe will pop up. It will look something like thispyuic5 -x [NAME_OF_UI_FILE].ui [NAME_OF_PY_FILE].py