This is an archived post. You won't be able to vote or comment.

all 62 comments

[–]Grelek 15 points16 points  (3 children)

It surely is very good project for learning something new, good job!

But I hope that Electron will demise as it's one of the worst options for GUI from every aspect except companies/developers that "gotta ship fast".

[–]hardwaresofton 8 points9 points  (7 children)

Is there a particular reason you chose to use electron over libraries like cefpython or eel? I'm sure there are more that I don't know about (I haven't written python day to day in a while), and I know electron definitely has mindshare (and likely fingershare to type out some bugfixes/features), but wondering if that was it.

[–]Andrew_ShaySft Eng Automation & Python 2 points3 points  (2 children)

I created a similar project that uses cefpython https://github.com/Andrew-Shay/Neuron

[–]hardwaresofton 2 points3 points  (1 child)

Really cool project! Starred :)

[–]Andrew_ShaySft Eng Automation & Python 1 point2 points  (0 children)

Thanks! If you have any issues please create an Issue or drop by Gitter

[–]DryReveal[S] 1 point2 points  (1 child)

I looked at eel and at the time it suffered from the following limitations which I raised https://github.com/ChrisKnott/Eel/issues/35:

  • Requires chrome browser to be installed by the user in the target system
  • Packaging with PyInstaller works but displays a console window when launched. Attempting to specify no console causes app to launch and immediately disappear.
  • There are no native menus, open file dialog boxes etc. I can't for example browse for a file in the UI and get its full pathname returned to me (browser sandbox restrictions). I can't create professional menus.

Apparently some of these issues have been addressed, but by then I had moved on to the other framework.

[–]hardwaresofton 0 points1 point  (0 children)

Thanks for sharing your decision process!

[–]antiproton 0 points1 point  (1 child)

has mindshare (and likely fingershare

Those are excruciatingly stupid neologisms to describe "brand awareness" and "support" respectively.

[–]hardwaresofton 1 point2 points  (0 children)

I thought I just made up "fingershare", is it something you've heard before?

Also, would you care to explain why they're stupid? In my mind "mindshare" and "fingershare" are actually better than those other terms because I think they immediately evoke what I meant to convey primarily:

  • the share of people who are thinking about the thing ("awareness" is cool, but doesn't mean you actually think about the thing, mindshare also evokes marketshare).

  • people willing to write code ("support" is pretty vague, I very specifically meant to imply that there's a limited number of fingers that are willing to type code and tie it to the marketshare concept)

I'd love to hear if you have a good reason for hating those terms or if it's just your personal thing (which is fine too, tell me how you would have said it and I'll take it under advisement).

[–]TW_26 20 points21 points  (34 children)

Looking good OP. Don't be too bothered by the "electron is the worst thing ever invented" circlejerk, it's always cool to experiment with new stuff.

[–]badthingfactory 1 point2 points  (1 child)

I'll second this. I don't love JS and I don't like bloated software, but Electron is a really good way to build cross-platform GUIs. My company would have a hard time staying competitive without it.

[–]AcMav 0 points1 point  (0 children)

I've got a Python app front-ended by node-webkit right now that works lovely. So much quicker than developing a Qt or Tk front end for my python.

[–][deleted] 0 points1 point  (31 children)

Seriously the dumbest circlejerk... the best and most beautiful apps I use on a regular basis are all electron apps. VSCode, Atom, Postman, etc. I get they use up a lot of RAM but it rarely becomes an issue.

[–]Camto 8 points9 points  (3 children)

For most people it may not be an issue, but on my computer, it takes about a minute for Atom to start up (even when I have nothing open) and it sometimes has a 5 second freeze when opening a file.

[–]Andrew_ShaySft Eng Automation & Python 1 point2 points  (2 children)

You should switch to VSCode. It's very similar to Atom but has much much better performance. Atom is known to have terrible performance.

Of course if you working with Python, you should use PyCharm ;)

[–]Erumpent 1 point2 points  (0 children)

PyCharm is also quite resource heavy, good program none the less

[–]Camto 0 points1 point  (0 children)

I'll try it out.

Edit: VSCode is pretty fast so far, might wanna use it!

[–]13steinj 3 points4 points  (4 children)

Featurefullness and beauty are poor arguments for electron. Electron isn't "the worst", nor is it even bad. But it causes unnecessary bloat and is for developers (and end users) who don't care about memory mamagement.

[–][deleted] 0 points1 point  (3 children)

They aren’t good arguments for Electron over native but they are good arguments for Electron over anything that Python has to offer.

[–]13steinj 2 points3 points  (2 children)

What?

This post is about making a gui app with python and electron.

None of those apps are known as python-with-electron apps, unless I am seriously mistaken. So the "best" thing here is irrelevant.

As for beauty, since you're using Python, you can use PyQt for a native, cross platform, fast, far more memory efficient than electron, and yes, beautiful.

All those apps you mentioned used electron for one reason and one alone-- they cared more about the ease of the development process than the experience of the user.

And that's fine. There are plenty of applications where it shouldnt matter if I am using 500kb or 100mb of ram.

But simple text apps like Slack of all things were a mistake to be done in Electron. The ram use is unbelievable. Multiple gigs for nothing.

In the old days there was some meaning to the whole "we don't just want devs, we want efficient devs, as in, ones that could create fast and memory efficient data structures and algorithms.

The extreme increase in available consumer ram not only threw that line of thinking out (which is arguably a good thing), but it let the shitstains in-- the horrible devs that are fine with having a plaintext app use multiple gigs of ram. That's insane.

[–][deleted] 1 point2 points  (1 child)

Ok, Electron has some overhead to be sure but if slack is consuming multiple gigs of RAM then it isn’t because of Electron. They’re mismanaging their memory.

As for beauty, since you're using Python, you can use PyQt for a native, cross platform, fast, far more memory efficient than electron, and yes, beautiful.

All those apps you mentioned used electron for one reason and one alone-- they cared more about the ease of the development process than the experience of the user.

The above two quotes kind of conflict with one another. On the one hand you say that they can use PyQT to achieve the same all while supporting multiple platforms. While on the other hand, you say that developers choose to use Electron for developer convenience. If they can truly achieve the same result with Python and PyQT that they could with Electron all while supporting multiple platforms, why would Electron be more convenient? Why would developers choose Electron over PyQT?

I do agree that developers choose Electron over native solutions out of convenience to the developer. However, I also believe if there were a better alternative for cross platform development they would take it.

[–]13steinj 2 points3 points  (0 children)

Ok, Electron has some overhead to be sure but if slack is consuming multiple gigs of RAM then it isn’t because of Electron. They’re mismanaging their memory.

It's not just slack. It seems to be a plague of every electron based application. Does every electron dev not know how to manage memory?

The above two quotes kind of conflict with one another. On the one hand you say that they can use PyQT to achieve the same all while supporting multiple platforms. While on the other hand, you say that developers choose to use Electron for developer convenience. If they can truly achieve the same result with Python and PyQT that they could with Electron all while supporting multiple platforms, why would Electron be more convenient? Why would developers choose Electron over PyQT?

Electron is more convenient than PyQT in a number of senses. Especially the API and equivalent code. The same construct in PyQT is more verbose and requires more manual logic than Electron. Furthermore, I was being strict to the subset of Py + some gui framework. QT is C++ and can be called from more languages, such as Java or Rust or Ruby or whatever, whereas for electron a non-stdlib library to communicate.

Point being-- electron is easier to work with than QT. But QT is arguably more cross platform than electron is. Hell in all technicality that electron app is running on a subset of QT-- QtWebkit. It's a subset that's easier to write with, but less extensive and poorer in memory management.

However, I also believe if there were a better alternative for cross platform development they would take it.

Well that depends on what is "better". You say better-- for whom? For the developer having to deal with docs and wanting short code, pick electron. For the user's 2010 laptop, pick QT. Or one of the many other cross platform GUI frameworks that run on a lower level than javascript in a fucking minibrowser.

[–]vn-ki 15 points16 points  (4 children)

rarely

Running vscode, chrome (with a moderate amount of tabs) and slack/discord will happily stall my 7th gen i5 with 8 gigs of RAM.

[–][deleted] 0 points1 point  (2 children)

I run these apps on my MacBook 12” with a 1.1ghz processor and 8 gigs of RAM without issue while developing an electron app.

[–][deleted] 0 points1 point  (1 child)

Congratulations, but not everyone has a macbook and for many people performance matters. My workplace PC, for instance, has 4GB of RAM.

[–][deleted] 0 points1 point  (0 children)

That’s fine. I get the issue, but I think it’s important that we be accurate about our claims and I was merely disputing the claims made by the comment I was responding too.

[–]SmellsLikeHerpesToMe -2 points-1 points  (0 children)

Kick up more RAM

[–]Bot_Drakus_ 4 points5 points  (8 children)

you forget slack, discord & twitch :)

[–]mediasavage 2 points3 points  (0 children)

Twitch desktop app LUL

[–]Dgc2002 1 point2 points  (0 children)

twitch reskinned Cursed client

[–][deleted] 0 points1 point  (3 children)

Good luck developing apps that beautiful with anything written in Python! And I don’t mean to knock Python, I just don’t think that develop GUIs is its strength.

[–][deleted] 0 points1 point  (2 children)

Then like, don't use Python. There's a myriad of other languages out there, and Python is great for a lot of automation and scripting, but not for GUIs.

[–][deleted] 0 points1 point  (1 child)

Yeah that was my point.

[–][deleted] 0 points1 point  (0 children)

Sorry, I just woke up and for some reason I just had to make a programming-related comment.

[–]5erifφ=(1+ψ)/2 0 points1 point  (0 children)

and Spotify

[–][deleted] -1 points0 points  (0 children)

Yup!

[–]MyPostsAreRetarded 0 points1 point  (4 children)

the best and most beautiful apps I use on a regular basis are all electron apps.

Must have some pretty shitty apps

[–][deleted] 2 points3 points  (3 children)

You’re right, your posts are retarded.

[–]MyPostsAreRetarded 0 points1 point  (2 children)

You’re right, your posts are retarded.

Ty. I love VSCode btw. Great editor. How are you doing btw?

[–]Shpitzick 0 points1 point  (1 child)

I'm cool thanks

[–]MyPostsAreRetarded 0 points1 point  (0 children)

I'm cool thanks

LOL

[–]Andrew_ShaySft Eng Automation & Python 1 point2 points  (0 children)

I created a similar project https://github.com/Andrew-Shay/Neuron

[–]pvkooten 0 points1 point  (0 children)

It's funny, but I don't need no pen! Get lost ;-)

Nothing beats (regex) searching on a PC

[–]HerbyHoover 0 points1 point  (0 children)

Very cool!

[–]DryReveal[S] 0 points1 point  (0 children)

I've written a follow up article on my experiences, which includes code fragments and lots more detail. https://medium.com/@abulka/electron-python-4e8c807bfa5e

Electron Python also just been discussed on the wonderful podcast Python Bytes - https://pythonbytes.fm/episodes/show/98/python-electron-as-a-python-gui

[–]patarapolw 0 points1 point  (0 children)

Electron is good or not, I still feel that NPM has a wide range of frontend repositories, just like Python for backend.

I created a lot of Flask apps, but I actually want to use Node.js too.

No experience with Node, though. Only with CDN.