Making modern GUIs with Python and ElectronJS

  Рет қаралды 660,719

Sourav Johar

Sourav Johar

Күн бұрын

Learn to make a modern looking, cross platform desktop apps using ElectronJS with Python.
Use electronJS as a front end for your Python apps.
NodeJS: nodejs.org/en/
ElectronJS: electronjs.org
python-shell: www.npmjs.com/...
Code: github.com/Sou...

Пікірлер: 460
@obamabinladen5106
@obamabinladen5106 5 жыл бұрын
As far as I am concerned this is the only video of its kind . Helped me alot. Thank you sooo much .
@thanatosor
@thanatosor 4 жыл бұрын
In a nutshell: use Python-Shell inside electron
@pradhumnaguruprasad2418
@pradhumnaguruprasad2418 3 жыл бұрын
Hi. Thanks for the beautiful video on this one of a kind implementation. It would be helpful if you could show us on how to package the whole app and distribute it. As we use electron for cross-platform development. Thanks in advance for the packaging tutorial.
@tech-preneurshipwithjeff5745
@tech-preneurshipwithjeff5745 6 жыл бұрын
Lovely post. I just learnt this new method of binding python and electron. I have been thinking of how to use python and electron for my new desktop application and you just came through with this perfect demonstration. Thanks alot
@satyambhargav9661
@satyambhargav9661 3 жыл бұрын
if you are referring the following video and using electron version 10 or above then you must add the following code in electron main.js: - const mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true } }) otherwise electron will not be able to call your python file when you click a button on your HTML file.
@mehulsolanki9435
@mehulsolanki9435 5 жыл бұрын
I referred a lot of videos and articles regarding electron to solve my problem. But, this was the best! Crisp and clear. Thank you soo much. Continue the good work 👌👌
@valmormn
@valmormn 6 жыл бұрын
Bro. I need to hang out more with smart people like you. Thank's a lot!
@aryanshbhargavan2775
@aryanshbhargavan2775 3 жыл бұрын
@@justafighter1346 r/iamverysmart content
@ElvenSkywalker
@ElvenSkywalker 6 жыл бұрын
An excellent tutorial. Possibly the only one online currently on using Python with Electron.
@oxodao
@oxodao 6 жыл бұрын
Yeah bc that's not how computer science works
@Taki7o7
@Taki7o7 6 жыл бұрын
If you see something on youtube, be sure it's not inefficient crap like this "combination" lmfao
@revinprismane5476
@revinprismane5476 6 жыл бұрын
Finally I got the thing which I looking for centuries. Thanks!!!!!
@FaizKhan-fm6kg
@FaizKhan-fm6kg 5 жыл бұрын
lol
@techcode6086
@techcode6086 4 жыл бұрын
Its just a toy code. won't be useful for production. You need to improve integration and then package software into installer package. if your code is not opensource, then you need to find a way to prevent other to view your code.
@karantalwar9941
@karantalwar9941 5 жыл бұрын
How to package this python shell along with electron js in windows/linux ?
@RobertLugg
@RobertLugg 4 жыл бұрын
I think your question is most important. It seems a difficult task.
@al_insight
@al_insight 5 жыл бұрын
thanks for your idea and a lot more please don't let anyone comment discourage your efforts keep on helping other with your skills and knowledge.
@davidturner1079
@davidturner1079 4 жыл бұрын
Where is the LOVE button. This may be a little older, but this is AMAZINGLY PERFECT! Anyone starting should see this as one of their FIRST videos! THANK YOU!!!! THANK YOU! Thank You from the bottom of my heart!
@CA_MKSingh
@CA_MKSingh 5 жыл бұрын
Hello Sourav! Great job, Explained everything very clearly. Now, would you like to guide on how to pack this app as standalone installer. Thanks in advance bro
@rafaelgpontes
@rafaelgpontes 4 жыл бұрын
I also want this!!!! Please, answer!
@minituff
@minituff 5 жыл бұрын
This is super helpful. How do I create a Windows installer that also includes the python code? I can only find tutorials that only include the gui folder.
@Ladsyadsy
@Ladsyadsy 3 жыл бұрын
Did you find solution to this?
@mayanxoni
@mayanxoni 4 жыл бұрын
Thanks a lot Sourav! Your video helped me a lot in turning my project beautiful in an easy way. Also, kudos to KZbin's algorithm 😁
@martincastellon5701
@martincastellon5701 4 жыл бұрын
Great tutorial. Just left we with one question, what happens when you compile, does the engine folder compile together or the user has to manually place the folder along the builded .exe?
@elliotth30
@elliotth30 2 жыл бұрын
Did you find the answer to this?
@sandipbamrel2087
@sandipbamrel2087 5 жыл бұрын
lol this is pure genius ,, keep it up man we want more stuff like this.
@iamakifislam
@iamakifislam 3 жыл бұрын
I was finding a video like this for last 6 months!!
@jagdishshetty4782
@jagdishshetty4782 4 жыл бұрын
Thanks for the explanation. Like the simplicity of the presentation.
@manuzsanand
@manuzsanand 5 жыл бұрын
Keep uploading such videos. You just earned a new subscriber.
@manas_singh
@manas_singh 4 жыл бұрын
Is there a way to package everything into a single .exe or .msi using electron-packager? Including the python applets, specifically.
@BoukariYameogo
@BoukariYameogo 4 жыл бұрын
here is an explanation how to pack electron+python app to a standalone executable file medium.com/@abulka/electron-python-4e8c807bfa5e
@techoxicated8933
@techoxicated8933 6 жыл бұрын
how would you install dependencies for python on client machine
@theophilejr886
@theophilejr886 6 жыл бұрын
Compilation
@kagwad_in
@kagwad_in 5 жыл бұрын
first install npm installl pip then pip install (dependencies)
@senthilkumarpalanisamy365
@senthilkumarpalanisamy365 3 жыл бұрын
Excellent video bro. Please post more.
@manoharkoya2524
@manoharkoya2524 5 жыл бұрын
browser console error is "require is not defined " can anyone help it isn't working in electron window
@jinhanaura
@jinhanaura 7 ай бұрын
how to export excutable file?
@girishmohanas
@girishmohanas 2 ай бұрын
iam getting unable to reference python-shell even though it is installed and getting listed
@SyfulIslamSharif
@SyfulIslamSharif 6 жыл бұрын
Amazing! Thanks for sharing with us.
@jsdfsfasfs
@jsdfsfasfs 6 жыл бұрын
Beware that electron apps consume lots of memory! Just something to consider
@freemind108
@freemind108 4 жыл бұрын
That's right
@RamiAwar
@RamiAwar 5 жыл бұрын
For the object detection, you could use TCP for message passing, running both a python process and the electron app, and allowing IPC using something like ZeroMQ, ZeroRPC, ... This would decrease the overhead of running the flask server by a bit.
@SouravJohar
@SouravJohar 5 жыл бұрын
Thanks, I'll try it out!
@tgrem
@tgrem 4 жыл бұрын
What about compile the app? There 15:30 you are seting a static path for python on your computer, if run this app in another comuter it wont run correctly. The same for compiling, i need to install python in the same exactly path you put in tha config object. Solution? Need i bundle python with electron?
@rashidmehmood5008
@rashidmehmood5008 3 жыл бұрын
I am getting an error, require is not defined (uncaught reference error)
@rookiesforwork3887
@rookiesforwork3887 6 жыл бұрын
Thanks for this great video. I just want to know about it's performance if it's kind of a inventory management app with lots of requests in realtime.
@mauritiusholidays3564
@mauritiusholidays3564 4 жыл бұрын
Hi there, I have same question. Have you find any answer in this regard ? Kindly do share with me, thanks.
@天风-z6z
@天风-z6z 4 жыл бұрын
I had installed requests,but it cannot find the module , events.js:182 Uncaught PythonShellError: ModuleNotFoundError: No module named 'requests'
@privetvastutnestoyalo2339
@privetvastutnestoyalo2339 6 жыл бұрын
Qt is not ancient-looking. You can style it just like any web-based UI. There's also QML.
@ttk-ainil
@ttk-ainil 5 жыл бұрын
qt is not free (for commercial use) though
@chironlionel6770
@chironlionel6770 5 жыл бұрын
Qt is unhappily platform dependent..
@vmohakrish
@vmohakrish 3 жыл бұрын
Nice video Sourav!! .I would like to know what is the level of expertise I would need on NodeJs to do this.
@nitinkumar29
@nitinkumar29 4 жыл бұрын
It is so confusing, there are so many JS based thing going on...AJAX, NodeJS, React and this and that ... ElectronJS. What to learn? Btw amazing video!
@princedey6536
@princedey6536 6 жыл бұрын
Hey i did everything same as you, installed python-shell using command "npm install python-shell" but when executing, i get python is not a constructor. Any help will be highly appretiated.
@donnyself5168
@donnyself5168 6 жыл бұрын
check my comment, I had the same issue.
@gkilm
@gkilm 5 жыл бұрын
Nice. How do you deploy and package it into a working app? It worked until I deployed mine
@danyalzaki4364
@danyalzaki4364 3 жыл бұрын
i dont understand , is he changing the image file to bytes can't we just pass in the image value .... someone please help
@amolkale1158
@amolkale1158 3 жыл бұрын
Is it possible to bundle a flask application inside electron??
@learnapplybuild
@learnapplybuild 5 жыл бұрын
You do not have all files in the GitHub repo....please add them
@SouravJohar
@SouravJohar 5 жыл бұрын
It's all there. I recently removed the face recognition part due to some technical reasons. If you want those files, you can get them from an earlier commit
@granand
@granand 3 жыл бұрын
Can I integrate this with database and excel ..I have a requirement & inspired by this I want to follow you but my end users use this app ..but one path should go to excel & other should write into database
@Blure
@Blure 6 жыл бұрын
Awesome work, mate. Please more Python tutorials!
@ramjadav1190
@ramjadav1190 3 жыл бұрын
if i create separate folders like you, i am getting error, please help!!
@adrianmanuelorayeabrasaldo
@adrianmanuelorayeabrasaldo 5 жыл бұрын
Hi is it possible to embed the camera/video to the GUI/Interface? instead of showing another window for the camera/video.
@manjunathnagendra9014
@manjunathnagendra9014 5 жыл бұрын
A great tutorial. I tried publishing app on the desktop with an icon. Once I click the icon app opens but only front-end works. the back-end python script not working.
@SouravJohar
@SouravJohar 5 жыл бұрын
I was able to successfully package this app as an executable. I plan to make a video about it in the coming days.
@FranVarVar
@FranVarVar 4 жыл бұрын
@@SouravJohar Hi Sourav, did you finally make the video?
@abhishek-kapoor
@abhishek-kapoor 5 жыл бұрын
Local package.json exists, but node_modules missing, did you mean to install?
@pushpendraverma1554
@pushpendraverma1554 3 жыл бұрын
I understood nothing, but i liked it...
@lakshbk
@lakshbk 4 жыл бұрын
the git repo doesnt have the face detection files
@rishavs1998
@rishavs1998 5 жыл бұрын
Awesome and unique tutorial ❤️❤️
@HumbleHistorian
@HumbleHistorian 5 жыл бұрын
The comments are awesome :). So I'll check your video out bro !
@ubaid9173
@ubaid9173 3 жыл бұрын
This tutorial is very amazing and helpful but how we will build these files to turn it to exe.
@ramjisubedi1991
@ramjisubedi1991 3 жыл бұрын
how can we create a Python Electron Database (mysql) app
@mr_daru
@mr_daru 5 жыл бұрын
This is so cool, but i have a question, How can i protect source code? for example, if i want other people use my app but i don't want anyone can copy my code, what will be the best way to protect this?
@thomh7434
@thomh7434 6 жыл бұрын
Good work man thank you for the tutorial ! Keep it up !
@kayderl
@kayderl 4 жыл бұрын
But can we compile this to become an app? Will the python program still run when we export electronjs to .exe or .app?
@vishnusaibhonsle7367
@vishnusaibhonsle7367 4 жыл бұрын
What about os module it will work?in this method
@about2mount
@about2mount 5 жыл бұрын
I like your presentation but I would question your use of Electron JS for anything related to IT GUI development. The whole point is security for Banking, Business Privacy and to prevent Foreign Espionage Hacks. If you have seen Googles Search Engine, it does this without Electron or JS. How? By Serving itself and searching websites with internal Bots and formatting that data back into itself. And is extremely fast. You can do this without Electron by simply serving a Python website localhost server and reading Post, Get and JS onclick events directly from forms or hyperlinks directly into Python without all these extra methods or bloated libraries and while being able to secure the back-end through Post fetching escape methods. Basically you had to write two entire files with several Classes and methods to do the handshake callbacks where Python itself only needs two to four lines per page for any form, button, hyperlink or onclick events to fetch data using the Post Method which is secure. Then all, it requires is Python with a few JS onclick events working the front end HTML without having to parse and secure data or without needing to implant a whole library within Python to do it. Electron is nearly as large as the Wx GUI Library besides. In fact you can do this much easier with Django and JS normally within the HTML only. Microsoft long ago did this with PowerPoint and Type Script for IT and the problem with using JavaScript for any IT GUI is security vulnerabilities which would be wide open for attack being on any server. And why they stopped using them. Even if using the Google Chrome API are still using a bound Port IP. Also Php has already tied into web GL, that allows it to work inside the server from the HTML5 Canvas and served by Php. And it is very secure. This only requires Php with the GL Library on any server and it allows JS also to do its magic on the HTML side. You can see this in use now within many Microsoft and Facebook Games. But for Gaming Electron is neat to use, but it will still work outside of Python which is not as Python Bloating. No Offence ! My advice is to latch onto Python's Kivy and GL because when this WASM converts everything over to Web-Assembly, JS is No More,, It is being replaced by the rapid Rust and C++ both running the browsers GUI, Nodes, and Dom directly from inside all browsers on the client side and server side. The whole reason for this is JS security injection issues costing businesses and Governments billion's of dollars and the bloating of all Browser Engines having to add new Parser methods for newer JS methods as Strings for these added securities, and having to convert all of these into their back-end language as pre loaded GUI Triggers which hampers request performance, optimization and has been a constant source for Hackers to do injection hacks without letup also. Soon it's Goodbye to JS !
@sknfer
@sknfer 2 жыл бұрын
Your comment is very interesting, may I follow you on Twitter?
@DanielRios549
@DanielRios549 3 жыл бұрын
The Electron works as an alternative to Qt and GTK, right?
@ferrinheight
@ferrinheight 5 жыл бұрын
Slightly misleading title. Whats actually going on is web based gui running python logic which also requires this to be hosted somewhere. For those looking to achieve this with just python take a look at Kivy which supports (win,lin,mac,android,ios). You can then use the ridiculously easy to use pyinstaller for win or mac. It is however good examples of how to integrate python as logic for web apps.
@kkfreakko105
@kkfreakko105 4 жыл бұрын
hi, if i want to build an executable for this app, is it straightforward with an electron-packager? i was previously working on python app and created an exe with pyinstaller... just wondering if on an electron-python app, does an electron packager manages the packaging on the python part as well...?
@techcode6086
@techcode6086 4 жыл бұрын
Appreciate Your efforts. nice work. But, This thing need much more improvements. keep it up.
@kristypolymath1359
@kristypolymath1359 4 жыл бұрын
Where is the GUI???
@matteoaldrigo3810
@matteoaldrigo3810 3 жыл бұрын
Ehy man, which do u used to create the html structure with button exc...?
@Lucas-gg9yb
@Lucas-gg9yb 4 жыл бұрын
Is this multiplataform?
@arjunpukale3310
@arjunpukale3310 4 жыл бұрын
Hi, please help me. I have a dependency model.pkl (pickle file) and my python script name is FinalModel.py which needs model.pkl. please tell me the command line code. Im getting errors.
@meetravi007
@meetravi007 5 жыл бұрын
Hi, I want to create a frontend UI which can run bash script in background and show output in that UI, How can I make it , any guidance
@jay199334
@jay199334 6 жыл бұрын
"npm install python-shell" is not working, it is giving error.
@sots_music
@sots_music 6 жыл бұрын
Cool tutorial man... Nice work
@nobisstudio8497
@nobisstudio8497 3 жыл бұрын
bro how send multiple argument here: var _option={ scriptPath:path.join(__dirname,""), args:["1"]["2"] } and hwo to recieve multipla data : import sys,json,numpy as np temp1=sys.argv[1] def myfun(num1,num2): i=num1+" hello world !"+num2 return i print(myfun(temp1)) sys.stdout.flush()
@himanish2006
@himanish2006 3 жыл бұрын
Thank you.. Good video.. Please connect Vue Js at the frontend ..
@100Jim
@100Jim 4 жыл бұрын
Hello my brother is creating a trading bot he wants me to create a GUI front end. would this be a good way?
@Netbase2000
@Netbase2000 3 жыл бұрын
Very helpful. Thank you
@urmilshroff
@urmilshroff 5 жыл бұрын
Very nice video man!
@amreshgiri4933
@amreshgiri4933 6 жыл бұрын
I was sick of PyQt. Thanks for introducing this.
@artyomostrikov
@artyomostrikov 4 жыл бұрын
Hello, i got this message in dev console -- Failed to load resource: net::ERR_FILE_NOT_FOUND in weather.py:1. This is the line where i import requests. How can i install requests or any other python library in electron?
@bennguyen1313
@bennguyen1313 5 жыл бұрын
Whether it's linux, mac or pc, after building the app to an .exe, does the end-user have to install electron or python for this to work? Or is the .exe file itself an install file rather than a portable .exe, that will install any (server-side) software needed to run?
@PaperBenni
@PaperBenni 4 жыл бұрын
How to make a simple utility take 3gb of ram.
@sps014
@sps014 4 жыл бұрын
4gb now
@thiagoa1851
@thiagoa1851 4 жыл бұрын
this app can be transformed in a electronjs desktop application? with a simple .exe installer
@sknfer
@sknfer 2 жыл бұрын
How can I compile it ??
@daveried9616
@daveried9616 6 жыл бұрын
How would I test if it is connected to python and see the python errors?
@saurabhjain3937
@saurabhjain3937 5 жыл бұрын
My python script is not getting called and is not executing. If I execute python script directly it is working fine
@roytex9901
@roytex9901 5 жыл бұрын
same
@polyviospatseadis9777
@polyviospatseadis9777 4 жыл бұрын
how to pass javascript elements on python fuction?
@PrakashPrakash-sn3do
@PrakashPrakash-sn3do 3 жыл бұрын
Thankyou so much : awesome information man
@helloworld8428
@helloworld8428 5 жыл бұрын
Thank you so much! Great video!
@hirenpatel6118
@hirenpatel6118 6 жыл бұрын
What if you want to distribute the app to windows? You can't expect the end user to have node.js installed. Just curious how you'd go about doing it
@chandherbb05
@chandherbb05 6 жыл бұрын
Hiren Patel you should look up election-builder. I use it at work. They package the application to an installer. That you can you ship to your end users
@StanleySalvatierra
@StanleySalvatierra 5 жыл бұрын
I think that I was seeing a python ReactJS tutorial :V until I recognize more carefully the electron icon.
@TheWyntas
@TheWyntas 4 жыл бұрын
lol
@yohahnribeiro6029
@yohahnribeiro6029 6 жыл бұрын
This is brilliant! Thanks a lot👍
@harmeepatel
@harmeepatel 6 жыл бұрын
how did u make those graphs move and that face detected animation....?? really interested in that....
@SouravJohar
@SouravJohar 6 жыл бұрын
Sweetalert.js and canvas.js respectively.
@ZooZingZap
@ZooZingZap 5 жыл бұрын
Can we use same code for web app instead of desktop app? pls guide...
@sallu21m
@sallu21m 5 жыл бұрын
Hi Saurav ....can you help in devp a desktop app for generating automatic question paper generator with python and mysql?? do let me know .....thanks
@eirik857
@eirik857 5 жыл бұрын
guys, i wanna use the facial recognition but i cant seem to get it to work on my pc.. any suggestions?
@deepakkumaryadav24
@deepakkumaryadav24 5 жыл бұрын
are you developing the web application or windows Desktop software? please excuse me if it sounds a silly question.
@SouravJohar
@SouravJohar 5 жыл бұрын
I'm developing a desktop application, using web development tools like HTML and JavaScript!
@deepakkumaryadav24
@deepakkumaryadav24 5 жыл бұрын
Can I deploy the same application as a window desktop app or download as exe file.
@SouravJohar
@SouravJohar 5 жыл бұрын
Yes certainly, electron works across various platforms as it runs on the Chromium engine. However, you would need to package the Python part as well. I recommend PyInstaller for that.
@bluesdog88
@bluesdog88 4 жыл бұрын
Will this work on a pc without flask/json etc?
@viralvideos9227
@viralvideos9227 5 жыл бұрын
Bro, I have some doughts if we use that will it make our application run slower
@helloworld8428
@helloworld8428 5 жыл бұрын
AMAZING VIDEO! THANK YOU SO MUCH! ME TOO, FROM INDIA
@ChumX100
@ChumX100 5 жыл бұрын
So Electron for the interface and some callbacks that start python processes. Not enough for more interactive apps. I still believe Jupyter + Ipywidgets create more powerful python apps in the browser.
@arlindburnutciu1311
@arlindburnutciu1311 4 жыл бұрын
Can you please update the Git, there is no face recognition... thnx
@MJFernandoIII
@MJFernandoIII 6 жыл бұрын
the installation process is a bit confusing for me