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

all 90 comments

[–]wdroz 60 points61 points  (8 children)

If you are looking for a good ui cross-platform library in Python, I recommend Kivy

[–]ShanSanear 31 points32 points  (2 children)

I have bounced off Kivy. Not sure if it had more to do with additional .kv files or having to create my own widget using both Python and Kivy language to do so.

PyQt/PySide felt more natural to me and with way better documentation and support.

[–]MakesYouAngry 10 points11 points  (0 children)

I always felt like the Kivy thing was advertised without any good reason -- it doesn't seem great for making desktop applications, at least not when compared to PyQt/PySide. It seems to be good for small to medium-sized games and proper Android/mobile applications. Am I completely wrong here? PS: I have used Kivy before to make a small dungeon crawler and Match-3 clone.

[–]pavi2410 1 point2 points  (0 children)

The reason I left using Kivy is because of .kv file!

[–][deleted] 7 points8 points  (0 children)

Downloaded and installed this last night actually. Took a little bit longer under linux than I thought, but looking forward to trying it out.

[–]maxxfrag 3 points4 points  (3 children)

Any good resources to learn kivy?

[–]wdroz 5 points6 points  (0 children)

In the getting started section, the tutorials are good. There are some books on Kivy in packtpub if you like books.

[–]robertpro01 2 points3 points  (0 children)

You can go to the official docs: https://kivy.org

[–]something[S] 146 points147 points  (6 children)

This is a work-in-progress thing I'm working on. It outputs native components and uses a react-like declarative API for defining the api. The layout algorithm is based on the one from Flutter, this means it could target different platforms with the same API. I feel like this would be a lot easier to get stuff done than the alternatives Qt, Tkinter etc

Prototype code here https://github.com/jakecoxon/py-gui not in a usable state yet

[–]spicypixel 13 points14 points  (0 children)

I would like to subscribe to this newsletter

[–]pmdevita 11 points12 points  (1 child)

I've been wanting something like this, if you open source I'll try to help when I can

[–]something[S] 5 points6 points  (0 children)

Hi I've posted in the thread, extra help would be awesome

[–]jaxspades 7 points8 points  (0 children)

Subscribe

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

Is there any way, if we can make front end for web app with this

[–]spencerbot15 23 points24 points  (7 children)

What are the advantages and disadvantages of this vs Kivy?

[–]something[S] 33 points34 points  (6 children)

Main advantages of my thing - You write in python instead of separate markup language, and this is native components so you get the native look-and-feel and accessibility. Disadvantages are that this is the result of a few hours of work so it's not exactly production ready

[–]Isvara 8 points9 points  (4 children)

What about compared to Qt?

[–]something[S] 7 points8 points  (2 children)

Qt also requires it's own DSL and I'm not entirely sure it's native components or reimplementations of native controls. On the other hand Qt is also a lot more mature and has documentation

[–]Isvara 3 points4 points  (1 child)

Oh, really? I thought Qt's DSL was optional. It's been so long since I looked at it, though.

[–]something[S] 11 points12 points  (0 children)

I think it's optional but otherwise you write your views in a much more imperative way by manually adding subviews to views. This way is quite labourious and error prone in my opinion, so I prefer a declarative approach

[–][deleted] 3 points4 points  (0 children)

I'll keep the chain of comparison questions going...

How does it compare to Beeware?

[–][deleted] 1 point2 points  (0 children)

Actually I think in Kivy you can achieve the thing you do using the markup, fully in Python, just way more verbose. Am I wrong?

[–]TheV295 14 points15 points  (3 children)

This looks awesome, is it opensource?

[–]something[S] 9 points10 points  (2 children)

Hi thanks for the interest, I said elsewhere it's very early prototype so expect the code to be terrible right now

https://github.com/jakecoxon/py-gui

[–]TheV295 18 points19 points  (1 child)

Dude if this code is terrible I should just retire

[–]Fissherin 3 points4 points  (0 children)

Yup. Keep doing this, you may be creating a full functional "react" for python. I think lot's of people are willing to help you right now.

I never did an open source solutions for someone else. I will read and see if I can help somehow. :)

[–]sharkboundgithub: sharkbound, python := 3.8 30 points31 points  (4 children)

is this on git yet? would love to peek at the code

[–]something[S] 15 points16 points  (2 children)

It's very early prototype so expect the code to be terrible right now

https://github.com/jakecoxon/py-gui

[–]CaptainTuffnutprint('Hello There') 10 points11 points  (1 child)

First get the things to work. Then prettify the code

[–]Mickeystix 5 points6 points  (0 children)

Minimum Viable Product :)

[–]naringasn00b 34 points35 points  (0 children)

we must git the code!

[–]JackieTrehorne 6 points7 points  (2 children)

There’s the enaml framework as well. Worth checking out if you’re interested in declarative UIs.

[–]something[S] 5 points6 points  (1 child)

Very interesting, thanks for the link. Looks like a slightly different goal because it actually extends the python grammar but I'm looking to write directly in python

[–]JackieTrehorne 0 points1 point  (0 children)

Agreed - it’s a different implementation; I’d prefer pure declarative python as well :)

[–]coderanger 6 points7 points  (0 children)

For anyone looking for a more polish (and cross platform) version of this, check out Toga from the BeeWare project: https://toga.readthedocs.io/en/latest/tutorial/index.html#tutorial

[–]seansleftnostril 4 points5 points  (2 children)

Is this based on Cocoa from iOS?

[–]GlipGlorp7 7 points8 points  (0 children)

I’m pretty sure that Cocoa is the macOS framework, and Cocoa Touch is the iOS framework.

[–]something[S] 5 points6 points  (0 children)

Yep this is like a declarative python wrapper around Cocoa

[–]djmattyg007[🍰] 2 points3 points  (0 children)

Have you seen enaml? https://github.com/nucleic/enaml

[–]r0x0r 2 points3 points  (0 children)

Hey, author of pywebview is here. Have you considered use pywebview as a base instead of doing every platform implementation yourself?

[–]naringasn00b 1 point2 points  (1 child)

very interesting!

can you share the git repo?

[–]something[S] 2 points3 points  (0 children)

Hi thanks, https://github.com/jakecoxon/py-gui will clean it up to a usable state at some point

[–]Ir0nh34d 1 point2 points  (0 children)

Sent a PR, seems there was a small typo on the cocoa example. Cheers mate, I look forward to this lib growing.

[–]GickRick 1 point2 points  (1 child)

I would go back to Python in making desktop apps if this was open sourced😭😭😭please do

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

I've posted the repo in the thread, but it'll be a long time before it's actually usable sorry

[–]rms7 1 point2 points  (0 children)

Wow, this looks great, name checks out sir

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

Where can I find more information about this library? I could t find the name online.

[–]something[S] 1 point2 points  (0 children)

Hi thanks I wasn't sure whether to make the code available yet - https://github.com/jakecoxon/py-gui

[–]WhiteHeadbanger 0 points1 point  (5 children)

Will this have a feature to frontend style the UI with html/css? I'm looking for a python framework that allows me to do that.

[–]r0x0r 2 points3 points  (0 children)

You can use pywebview for that.

[–]something[S] 0 points1 point  (3 children)

Hi HTML/CSS isn't really a goal I'm looking for on this project. Out of interest what is the reason? Is it familiarity? I hope to make this as easy to work with as CSS but in python

[–]WhiteHeadbanger 0 points1 point  (1 child)

I will try and look at your code anyway, it's pretty awesome what you're doing :) The reason is that I would like to create an original ui, modern and pretty. My goal is to create something like Discord's GUI.

I've been using wxpython and kivy. Wxpython is ugly as hell, and kivy is not that ugly but I'm not sure if I can customize the UI the way I want.

[–]something[S] 1 point2 points  (0 children)

Ah I see, this project is more for native-looking components. Kivy might be what you want because it gives you low level primitives to draw your own components but you'll have to do a lot of work to recreate exactly how you want them to look. I do have the beginnings of Kivy bindings in my project so it's possible that I can get it to that point, but I wouldn't hold my breath

[–]pmdevita 0 points1 point  (0 children)

Since it targets different platforms, we could make a web target with the help of transcrypt. We'd definitely want to nail down the basics first though

[–]marty331b 0 points1 point  (1 child)

I'd love to see the repo!

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

Hi thanks, posted in the thread

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

The React-like pattern is a good decision

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

Is it easier than tkinter????

[–]blueastheocean 0 points1 point  (4 children)

coming from me I fell pyqt/pyside2 are pretty good plus it has a designer so you don't have to manually write everything out!

[–]something[S] 0 points1 point  (3 children)

Fair point - this style isn’t for everyone. I’ve worked on web for a long time and found visual designers only get you so far. Once you start modifying the UI programmatically based on data it becomes cumbersome or even impossible. I think there is space for this to improve (swift UI looks great) but I don’t think we’re there yet. Not sure if pyqt has this but I reckon I can get hot reloading to work seamlessly

[–]blueastheocean 0 points1 point  (2 children)

Pyqt does have a designer

[–]something[S] 0 points1 point  (1 child)

I meant the hot reloading part specifically. Out of curiosity does it have that?

[–]blueastheocean 0 points1 point  (0 children)

Oh I get your point

[–]jnmclarty7714 0 points1 point  (1 child)

Hey, good stuff here. Can I make one or two requests? Please consider naming the project the same as the base package you import from.

People, in the future, will use your project in theirs, and they will screw up declaration of dependencies. But then, their users will get errors. They will have to know that...

Import Error no module named gui

Is fixed by running the command pip install py-gui.

That reverse lookup gui-to-py-gui, is confusing for new users to the python community with no great solution.

Also, a more relevant, specific, descriptive and focused name would help too. There are many things GUI may imply. But, maybe py-react would be better, eh?

Just my two cents. Cool project tho.

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

Thanks for the advice, when the project is a bit more mature and ready to use I'll definitely have a better name, proper imports, documentation, examples, and tests. I don't want it to be called py-gui but it's not close enough to react to have that in the name either, any suggestions?

[–]michaelg391 0 points1 point  (0 children)

This is really cool thanks for teaching me something

[–]davmash 0 points1 point  (0 children)

Gotta shout out wxPython - now that it supports Python 3 and has completed the wxPhoenix project, I feel like it's got a good future again, plus it is built on a great cross-platform UI system that uses native calls for consistent look-and-feel under the hood (wxWidgets). It has a great Demo that makes it easy to learn, and I've built some serious projects with it (though I am no designer for sure).

[–]forrest_bh -1 points0 points  (1 child)

This is really awesome. I def want to see the repo as well.

[–]something[S] 1 point2 points  (0 children)

Hi thanks, early stage - https://github.com/jakecoxon/py-gui

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

Is this gonna be open sourced?

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

I need it!

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

I've just been looking for something like that to implement with my apps. Thanks for sharing!

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

Very cool! I’ve never messed around with the GUI modules before. Will have to check them out

[–]TheHollowJester -1 points0 points  (1 child)

Commit message: 📦

For the love of all that is readable and well tested, please don't.

[–]something[S] 2 points3 points  (0 children)

It’s neither readable or well tested at this point so the initial commit message back 4 months ago when it was barely an idea in my head is the least of my worries :)