Making modern GUIs with Python and ElectronJS

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 460

  • @obamabinladen5106
    @obamabinladen5106 5 лет назад +27

    As far as I am concerned this is the only video of its kind . Helped me alot. Thank you sooo much .

  • @tech-preneurshipwithjeff5745
    @tech-preneurshipwithjeff5745 6 лет назад +9

    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

  • @pradhumnaguruprasad2418
    @pradhumnaguruprasad2418 3 года назад +15

    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.

  • @valmormn
    @valmormn 6 лет назад +28

    Bro. I need to hang out more with smart people like you. Thank's a lot!

  • @revinprismane5476
    @revinprismane5476 6 лет назад +21

    Finally I got the thing which I looking for centuries. Thanks!!!!!

    • @FaizKhan-fm6kg
      @FaizKhan-fm6kg 5 лет назад

      lol

    • @techcode6086
      @techcode6086 4 года назад +5

      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.

  • @ElvenSkywalker
    @ElvenSkywalker 6 лет назад +28

    An excellent tutorial. Possibly the only one online currently on using Python with Electron.

    • @oxodao
      @oxodao 6 лет назад +5

      Yeah bc that's not how computer science works

    • @Taki7o7
      @Taki7o7 6 лет назад +1

      If you see something on youtube, be sure it's not inefficient crap like this "combination" lmfao

  • @thanatosor
    @thanatosor 4 года назад +34

    In a nutshell: use Python-Shell inside electron

  • @mehulsolanki9435
    @mehulsolanki9435 5 лет назад +1

    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 👌👌

  • @iamakifislam
    @iamakifislam 3 года назад +1

    I was finding a video like this for last 6 months!!

  • @al_insight
    @al_insight 5 лет назад +1

    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.

  • @ozkaninonlu2898
    @ozkaninonlu2898 2 года назад

    Wow reaching this masterpiece after long time

  • @minituff
    @minituff 6 лет назад +15

    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 года назад +2

      Did you find solution to this?

  • @jagdishshetty4782
    @jagdishshetty4782 4 года назад

    Thanks for the explanation. Like the simplicity of the presentation.

  • @exclusiven940
    @exclusiven940 6 лет назад +17

    My my I can say surely that You will grow my bro!

  • @davidturner1079
    @davidturner1079 4 года назад +1

    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!

  • @satyambhargav9661
    @satyambhargav9661 4 года назад +4

    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.

  • @senthilkumarpalanisamy365
    @senthilkumarpalanisamy365 3 года назад

    Excellent video bro. Please post more.

  • @sandipbamrel2087
    @sandipbamrel2087 5 лет назад +11

    lol this is pure genius ,, keep it up man we want more stuff like this.

  • @ForeignMadeIt
    @ForeignMadeIt Год назад

    thank you for this. Great explanation of everything as well.

  • @mayanxoni
    @mayanxoni 5 лет назад +1

    Thanks a lot Sourav! Your video helped me a lot in turning my project beautiful in an easy way. Also, kudos to RUclips's algorithm 😁

  • @karantalwar9941
    @karantalwar9941 5 лет назад +28

    How to package this python shell along with electron js in windows/linux ?

    • @RobertLugg
      @RobertLugg 4 года назад +4

      I think your question is most important. It seems a difficult task.

  • @angelsancheese
    @angelsancheese 3 года назад +1

    Such helpful video. Thank you!

  • @manuzsanand
    @manuzsanand 5 лет назад +1

    Keep uploading such videos. You just earned a new subscriber.

  • @ramshankaryadhunath9302
    @ramshankaryadhunath9302 6 лет назад

    This was real good Sourav!

  • @martincastellon5701
    @martincastellon5701 4 года назад +6

    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?

  • @SyfulIslamSharif
    @SyfulIslamSharif 6 лет назад +7

    Amazing! Thanks for sharing with us.

  • @TheWyntas
    @TheWyntas 4 года назад

    Thank you, Sourav for your tutorial!

  • @CA_MKSingh
    @CA_MKSingh 5 лет назад +8

    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 года назад +1

      I also want this!!!! Please, answer!

  • @VictorCaldo
    @VictorCaldo 5 лет назад +1

    Dude you are amazing! Thanks for this video

  • @RamiAwar
    @RamiAwar 6 лет назад +1

    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.

  • @rishavs1998
    @rishavs1998 5 лет назад +1

    Awesome and unique tutorial ❤️❤️

  • @manas_singh
    @manas_singh 4 года назад +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 года назад +1

      here is an explanation how to pack electron+python app to a standalone executable file medium.com/@abulka/electron-python-4e8c807bfa5e

  • @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?

  • @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.

  • @ahmedanwer6899
    @ahmedanwer6899 3 года назад +1

    Hi Sourav, not sure if you are keeping up with the comments on this video or not, but I believe this approach doesn't work anymore because electron by default disabled node integration except from the main processes. So, if I do the weather example, I get a reference error that "require()" is not defined because weather.js is not a main process.
    Still figuring out a way around this change...

    • @grantcary
      @grantcary 2 года назад

      yeah I'm also getting "Failed to resolve module specifier "python-shell" and "path"" errors

    • @ahmedanwer6899
      @ahmedanwer6899 2 года назад

      @@grantcary I got through these errors luckily. What are you trying to do? I can try to help

  • @Blure
    @Blure 6 лет назад

    Awesome work, mate. Please more Python tutorials!

  • @sidhantsrivastava7426
    @sidhantsrivastava7426 4 года назад

    This is exactly what I was looking for

  • @PrakashPrakash-sn3do
    @PrakashPrakash-sn3do 3 года назад

    Thankyou so much : awesome information man

  • @jsdfsfasfs
    @jsdfsfasfs 6 лет назад +20

    Beware that electron apps consume lots of memory! Just something to consider

  • @Shahzaib786ik
    @Shahzaib786ik 6 лет назад

    Awesome Man!
    Was looking for something similar (y)

  • @tomasstefani7889
    @tomasstefani7889 5 месяцев назад

    Amazing bro! Thanks

  • @runtotheline
    @runtotheline 4 года назад +1

    I am getting a Uncaught reference error in the face.js linker file. The var python= require() parts won't work. Is this an electron js version issue?

  • @JeromeJaJa
    @JeromeJaJa 5 лет назад +5

    how would you package an app like this?

  • @sots_music
    @sots_music 6 лет назад

    Cool tutorial man... Nice work

  • @jinhanaura
    @jinhanaura 8 месяцев назад +1

    how to export excutable file?

  • @thomh7434
    @thomh7434 6 лет назад

    Good work man thank you for the tutorial ! Keep it up !

  • @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!

  • @marcpanther7924
    @marcpanther7924 6 лет назад +1

    Is Electron providing the widgets (i.e. the look and feel of your buttons)? I don't see any CSS there.

    • @SouravJohar
      @SouravJohar  6 лет назад

      I use bootstrap. It helps people like me who don't know much web development 😂

  • @Netbase2000
    @Netbase2000 3 года назад

    Very helpful. Thank you

  • @lorenzobalducci8882
    @lorenzobalducci8882 4 года назад

    If i want to distribute a builded standalone app in this way i'm going to use electron-package for the frontend...but how to put the python interpreter in a way that the vuilded app doesn't require python to be installed on the computer?

  • @rookiesforwork3887
    @rookiesforwork3887 6 лет назад +3

    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.

  • @urmilshroff
    @urmilshroff 5 лет назад

    Very nice video man!

  • @ram84364
    @ram84364 6 лет назад

    Cool man. U covered all my clarifications

  • @muhammadyusuf8644
    @muhammadyusuf8644 4 года назад

    While Using and clicking on submit in weather forecaster it redirects me to a blank page in both browser and electronjs app. In the browser it is seen in the bar "file:///path/to/electronjsapp/.../?" And shows that the file was not found and also seen that browser doesnt understand require () tag

  • @rbfreitas
    @rbfreitas 6 лет назад

    Awesome! Congrats!!! Nice video!!!

  • @luciano.7b6
    @luciano.7b6 4 года назад

    When executing object_detection.py the following error occurs: Could not find the DLL (s) 'msvcp140.dll or msvcp140_1.dll'. What version of Python TensorFlow to run the project?

  • @HumbleHistorian
    @HumbleHistorian 6 лет назад

    The comments are awesome :). So I'll check your video out bro !

  • @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.

  • @天风-z6z
    @天风-z6z 4 года назад

    I had installed requests,but it cannot find the module ,
    events.js:182 Uncaught PythonShellError: ModuleNotFoundError: No module named 'requests'

  • @gkilm
    @gkilm 5 лет назад +1

    Nice. How do you deploy and package it into a working app? It worked until I deployed mine

  • @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...?

  • @granand
    @granand 4 года назад

    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

  • @techoxicated8933
    @techoxicated8933 6 лет назад +12

    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)

  • @privetvastutnestoyalo2339
    @privetvastutnestoyalo2339 6 лет назад +3

    Qt is not ancient-looking. You can style it just like any web-based UI.
    There's also QML.

    • @ttk-ainil
      @ttk-ainil 6 лет назад

      qt is not free (for commercial use) though

    • @chironlionel6770
      @chironlionel6770 5 лет назад

      Qt is unhappily platform dependent..

  • @MrJohnny31LongHorn
    @MrJohnny31LongHorn 5 лет назад +1

    Hello, i installed all stuff, but when i enter any city in weather nothing happenning. What problem may be?

  • @abhishek-kapoor
    @abhishek-kapoor 5 лет назад

    Local package.json exists, but node_modules missing, did you mean to install?

  • @mohammedirshad3004
    @mohammedirshad3004 4 года назад +1

    When packing an app with electron. Does it require the client to have python already installed to work with it? I mean in eel, the user didn't need to install python right ???

    • @BoukariYameogo
      @BoukariYameogo 4 года назад

      I had the same question too because this is the most important part, it's not really worth it if the user needs to install python to make it work

    • @BoukariYameogo
      @BoukariYameogo 4 года назад +1

      I found a link that could be very helpful how to deploy a an electron app alongside with python. here is the link medium.com/@abulka/electron-python-4e8c807bfa5e

    • @mohammedirshad3004
      @mohammedirshad3004 4 года назад +1

      @@BoukariYameogo I found eel to be very useful for me..try it out

  • @princedey6536
    @princedey6536 6 лет назад +2

    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.

  • @pushpendraverma1554
    @pushpendraverma1554 3 года назад

    I understood nothing, but i liked it...

  • @amreshgiri4933
    @amreshgiri4933 6 лет назад +4

    I was sick of PyQt. Thanks for introducing this.

  • @ziyadkader6767
    @ziyadkader6767 6 лет назад +6

    what is the name of this colorsheme ? it looks amazing !

  • @chiragredij1734
    @chiragredij1734 2 года назад

    Hello... the python script I integrated referring to your video is not working... I cant seem to understand whats wrong with it

    • @chiragredij1734
      @chiragredij1734 2 года назад +1

      so i debugged step by step the JS and it starts with require not defined

  • @sampathmanju1
    @sampathmanju1 5 лет назад

    HI Bhaiyya,
    May I know, How you are making these videos? I am getting issues in audio sync.
    Any help or suggest highly appreciated.

  • @UdanaWickramasinghe
    @UdanaWickramasinghe 2 года назад

    Hi, Sourav Thanks for this video. R u interested to help us with a python desktop app that we are building with small functionality?

  • @ayushadarsh1385
    @ayushadarsh1385 4 года назад

    Great Video! Thanks man. Also, Is it possible to achieve database CRUD functionalities with this approach ?

  • @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.

  • @manjunathnagendra9014
    @manjunathnagendra9014 6 лет назад +1

    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  6 лет назад

      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?

  • @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?

  • @JPabloDonayreQuintana
    @JPabloDonayreQuintana 4 года назад

    How can we package this in order to install it in Windows or Linux ? (Not separatedly, but as a unique project ?)

  • @girishmohanas
    @girishmohanas 3 месяца назад

    iam getting unable to reference python-shell even though it is installed and getting listed

  • @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?

  • @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?

  • @DanielRios549
    @DanielRios549 3 года назад

    The Electron works as an alternative to Qt and GTK, right?

  • @helloworld8428
    @helloworld8428 5 лет назад

    Thank you so much! Great video!

  • @matteoaldrigo3810
    @matteoaldrigo3810 3 года назад

    Ehy man, which do u used to create the html structure with button exc...?

  • @TheGhost13X
    @TheGhost13X 5 лет назад

    Hi, Im making an app, but when I import bluetooth library to Python code, Im getting error "no bluetooth module found", can someone help? Thank you.

  • @yohahnribeiro6029
    @yohahnribeiro6029 6 лет назад

    This is brilliant! Thanks a lot👍

  • @Thehighschoolscientistforever
    @Thehighschoolscientistforever 3 года назад

    Hey I need some guidance on my next project.
    I am planning to make a desktop app using electron to manage finances, manage inventory & track orders so I need this desktop app to have a local database but I don't want other people to install any kind of external database software it should be like packaged within the app itself , and also this desktop app should be connected with some kind of online database (more on this later). And I also have made an android app to manage the end customer and provide them with regular updates and also collect data from them. Till now I have been using Google sheets and a web app to manage everything but this has recently become really problematic (many many issues) So I need to deploy my own database (local server or online server basically anywhere possible) and this has to be connected with my the electron app and the android app
    .
    .
    So basically 3 things
    => a desktop app with a embedded database & also linked to a online database
    => A android app which is connected to the online database
    => and the database itself Which manages all the data from the android app user and the desktop app user
    .
    .
    I have created the android app & also making the electron app seems doable BUT the embedded database & server database part seems really confusing and I have no clue what to do or where to start (the reason I picked electron for the desktop app is because I am really familiar with Javascript, HTML & CSS)
    .
    So I need some guidance (maybe alot) to make this happen

  • @amolkale1158
    @amolkale1158 3 года назад

    Is it possible to bundle a flask application inside electron??

  • @rslider00
    @rslider00 5 лет назад

    Also looking for a fix for the require not defined. I know this is an issue with Electon V5, specifically with NodeIntegration being false, but even when I turn it to true (and ContextIsolation to true just in case), I get no results. Very little info out there on the web too since v5 is relatively new and this is seemingly a big change.
    Any help would be greatly appreciated!

  • @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?

  • @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?

  • @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

  • @leegrey1401
    @leegrey1401 6 лет назад

    Did you try to use .send() and .receive() from python-shell? Not that Flask is a bad solution, but it seems like you could have used python-shell for Object Detection, as well. I'm curious to know if you tried that but ran into problems.

    • @SouravJohar
      @SouravJohar  6 лет назад

      I did try that, but like I said in the video, whenever I start the object detection code, it takes a long time to initialize and load the model. That's why I used flask, that way the model is always in memory

  • @thomastsojan4367
    @thomastsojan4367 5 лет назад

    Very Good really interesting.....

  • @manoharkoya2524
    @manoharkoya2524 5 лет назад +1

    browser console error is "require is not defined " can anyone help
    it isn't working in electron window

  • @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

  • @rashidmehmood5008
    @rashidmehmood5008 3 года назад

    I am getting an error,
    require is not defined (uncaught reference error)

  • @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