Python GUI versus Swing?

I wanted to say “a better python GUI compared to Swing” ... but said sternly that my question is “too subjective”. I apologize for the deterministic ghost in the car.

I am currently using Jython ... using it already 6 months after several years of Java. I like Jython's ability to call all Java classes, and also make it easier to transition from the Java way of doing things in Python.

But thinking about this, I understand that the most common Java packages that I use are Swing. I have been fighting Swing for many years and, finally, I think that I have a beast under some kind of castle. I also think that Swing is wonderful, by the way, and I have to say that, for example, I’m something like a keyboard fanatic, so I would not want to switch to a graphical interface where you have no power, akin to what is hidden in ActionMap- An InputMap that maybe not many people care so much about. It would also be a shame to turn my back on JTree and JTable, spending so much time tearing out what was left of my hair about them. Seriously, they are devilishly strong ...

But at the same time, I quickly get hung up on Python's way of doing things. I can and intend to stick with Jython. But I'm just wondering what the various CPython GUIs look like ... and specifically, how much are their strength and versatility compared to Swing?

added: I was asked to indicate some features: it’s good that with the tree of the GUI object sitting on the scroll bar, where possible, if you want, control the navigation and collapse / expand nodes using the keyboard ... where scrolling occurs automatically (if you want it) and where you have control over the appearance, etc. or tables in which you have full control over the resizing, what happens when individual cells gain / lose focus. Where you can create renderers and subclass editors. As I said in my comment, someone who was / was passionate and a big Swing user, but nonetheless made the transition to the CPython GUI and was happy / not happy ... might be the perfect person to answer this question.

+6
source share
2 answers

I have never done anything with Swing, but Qt (and its bython, PySide or PyQt4 bindings) matches all your criteria, as far as I can understand them.

Qt focuses on doing things as is customary on the underlying OS. Therefore, the most obvious task is usually the “right” thing, but if you want to control, you can go and redefine the appearance or behavior.

As for the pythonic way of doing things ... The bonds get there. Honestly, they still feel a little C ++ - ey.

Also read a few other questions compared between them.

+2
source

I think Python has many GUI tools. Java has Swing. If you want to develop a cross-platform friendly GUI, I suggest WxPython.

0
source

Source: https://habr.com/ru/post/899483/


All Articles