GUI for Python? - Page 1
Forum section: electronics / general

author: RoGeorge
author_rank: Super Contributor
timestamp: June 07, 2022, 10:40:09 am
content: Any recommendation from your personal experience? What GUI to use for Python?- would like to be something "python-esque", easy to use for non-programmers, just like Python is easier to use for amateurs than, say, C++ would be.- has to have a drag&drop graphic editor to add controls and design the GUI, designing the layout by writing code is not productive for me- preferably open source and definitely free, it's for hobby and non-commercial projects- for my level of skills, the old VB5 was just right, with drag and drop buttons and auto generated code, then all you have to do was to populate the empty template with code for the desired actions, would prefer an equivalent for that VB5 style, if there is any- multiplatform preferably, Linux is a mustGoogled already, and tried so far a couple of them:1. Qt and its "Qt Designer" - (that was some time ago, IIRC the wrapper module was called PyQt), thought I remember it as very cumbersome, hard to learn and also Qt is not entirely free (depending on the type of license one need/choose),certainly not FOSS2. PySimpleGUI - that was the simplest to use so far, but there's no GUI designer for PySimpleGUI, only some unbaked attempts to import XML ui produced by Qt Designer, which import tool seems abandoned and doesn't work any more3. DearPyGui - it's very "Windows-ish" (has a registry for its GUI no matter the OS), thought it's open source and with MIT license. The main drawback (for me) is that it's not really for preparing a GUI, but more for making/developing tools for 2D/3D games. DearPyGui is based on ImGui, a C++ lib/engine for game devs, which ImGui is sponsored by big names like Blizzard or Ubisoft. The Python wrapper is very impressive and working, yet it is too recent, the video tutorials from 1-2 years ago are almost not applicable to current version. And still doesn't have a drag and drop designer.They are all great Python GUI programs, yet none are just right for me. The GUI part feels to me like a dragging or a chore task, maybe it's just me, or maybe I have wrong expectation, IDK.Been looking for something easy, to use for small project/single developer. For example to slap a GUI on a small board I make, or to control an existing devboard, or an instrument around the lab, things like that. For example adding a GUI for a data logger from a COM port, or a GUI for an SCPI tool to automate repeated measurements, or other small Python programs like that. I'm using mostly Linux/KDE (Kubuntu).What did you guys are using for that, or seen and liked, when it comes to making a GUI, or what do you think I should try?

author: GeorgeCh
author_rank: Contributor
timestamp: June 07, 2022, 10:56:35 am
content: Hi,I've tried a number of things but in the end Qt Designer and PyQt seemed more usable and more baked. Yes, at first its hard and cumbersome, but for simple GUIs will be fast and hassle free enough to be worth it.I use it from time to time for the exact same purpose -> simple GUI for whatever project I'm working at that moment.GPS: If you need to create graphs take a look at PyQtGraph

author: emece67
author_rank: Frequent Contributor
timestamp: June 07, 2022, 11:07:50 am
content: .

author: RoGeorge
author_rank: Super Contributor
timestamp: June 07, 2022, 05:52:24 pm
content: In this case back to square one, I guess, thank you both. Meaning back to Qt, will put some extra effort into learning more Qt. Its Qt Designer is very good, indeed.

author: GeorgeCh
author_rank: Contributor
timestamp: June 08, 2022, 05:40:53 am
content: As will all python things, you will make rapid progress in your application. You can take comfort in this at least.G

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 08, 2022, 06:06:27 am
content: Quote from: RoGeorge on June 07, 2022, 10:40:09 amAs a long-time non-gui C guy, what I have been using recently is Glade. I don't know if you'll find anything as seamless as VB. Glade does a pretty good job if you spend the time and watch any of the 20-video series tutorials on youtube. I recommend watching a series all or most of the way through to get a real feel for Glade.I only use C though (not python) because I'm not a masochist.[ducks for cover]edit: from the Glade Website:Quote

author: RoGeorge
author_rank: Super Contributor
timestamp: June 08, 2022, 07:01:44 am
content: Looks very eye candy, will give Glade a try, too, thanks.Used C in the past, but now I prefer Python. Python is more productive, and has modules for anything, from math to controlling an RTL-SDR.For amateur programmers like me, this is how writing in Python feels:

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 08, 2022, 07:19:26 am
content: Quote from: RoGeorge on June 08, 2022, 07:01:44 amFWIW, I have given Python a few fair chances to woo me during 'the thing'. I set up the full IDE python dev suites and I had nothing but trouble. The crashes. The libs. The IDE's desire to engulf your whole little project and spam your directory with stupid config files..I'm a simple man with simple needs. Geany and Glade. And C.Maybe it works better on windows. But Python makes me stabby.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 08, 2022, 08:56:32 am
content: I have no idea what Python IDE full dev suite means.AFAIK Python is only the interpreter for the Python language. Sometimes it came bundle with a very simple IDE called "IDLE" (mostly for Windows distributions). Any text editor or preferred IDE can be used instead IDLE. There is also an interactive mode, text only, where one can type Python in a terminal/cmd.Usually Python is already present in Linux. For Windows, I don't know. In the past for Windows it used to be an Python.exe to download and double click/next/next/next for installing. For something like a Debian flavour Linux it'sCode:apt install python3from a root terminal, or use sudo.One of the Python mantras is "batteries included", so most of the basic stuff is ready to use. However, to do something more weird, like plotting a 3D chart while controlling your favorite RTL-SDR usb radio, you'll need to add specialized Python modules (or write your own if you prefer).To install Python modules, there is a command line tool, called "pip", and official Python "repositories" (PyPI) for additional Python modules, so all you have to do to install additional Python functionality (modules) is to write in a command line:Code:pip install matplotlibpip install pyrtlsdrThen open any text editor, write and save this as RTL-SDR.pyCode:from pylab import *from rtlsdr import *sdr = RtlSdr()# configure devicesdr.sample_rate = 2.4e6sdr.center_freq = 95e6sdr.gain = 4samples = sdr.read_samples(256*1024)sdr.close()# use matplotlib to estimate and plot the PSDpsd(samples, NFFT=1024, Fs=sdr.sample_rate/1e6, Fc=sdr.center_freq/1e6)xlabel('Frequency (MHz)')ylabel('Relative power (dB)')show()To run it, in a terminal/cmd typeCode:python RTL-SDR.pyAnd you'll get thisSource:https://pypi.org/project/pyrtlsdr/Same can be achieved in interactive mode, by typing it all directly in Python (in a terminal/cmd type "python", then at the >>> python prompt type the above text), thought usually a .py script is preferred.It's that easy. You just learned how to Python.Joke aside, if you try to do the same plot in C, I'll bet it would be much harder, and will need a more complicated setup.

author: emece67
author_rank: Frequent Contributor
timestamp: June 08, 2022, 09:24:22 am
content: .

author: RoGeorge
author_rank: Super Contributor
timestamp: June 08, 2022, 09:39:11 am
content: He, he, same preference here. I'm usingVS Codium, which is VS Code compiled without Microsoft's telemetry and alike options.VS Code is one of the finest IDE out there, IMHO. Saying that while I'm not a Microsoft fan. Sometimes less known, VS Code / VS Codium is also free andopen source, even if it's a software coming from Microsoft.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 08, 2022, 09:40:38 am
content: Quote from: RoGeorge on June 08, 2022, 08:56:32 amInstalling IDE environments consisting of Eclipse or PyCharm. Even tried Eric.QuoteYes. But I wanted to follow along with various youtube tutes and be able to also take advantage of run/stop features.Nightmare.I think it was eclipse, a vanilla install, wouldn't even open a new project without choking. Java something or other.

author: emece67
author_rank: Frequent Contributor
timestamp: June 08, 2022, 10:59:05 am
content: .

author: RoGeorge
author_rank: Super Contributor
timestamp: June 08, 2022, 01:36:39 pm
content: Yep.- Install VS Codium as instructed for your OS:https://vscodium.com/- Open Codium and from inside it, hit Ctrl+Shift+X, and search for Python, to install the VS Codium extension called "Python", the one from Microsoft, with all the autocomplete, syntax, debugging, Jupyter, etc.- Close Codium then start it again, and that's it.Now inside VS Codium go to menu, File -> New file... and click Python File, and start typing your Python code:Code:print("B a z i n g a !!!")Hit Ctrl+F5 to Run it, or F5 to Debug run it.You are now almost Python guru level.Now, to get fancy and back to GUI, let's try a CPU % display with Tkinter, the default GUI framework coming with Python (batteries included is the Python mantra), GUI based on Tcl/Tk. However, to read the CPU usage we'll need to install a new Python module called 'psutil', by typing in a terminal/cmd:Code:pip install psutilBack to VS Codium and type this:Code:import psutilimport tkinter as tkdef update_label_2(): # a function to autoupdate the proc %cpu_percent = psutil.cpu_percent()label_2.config(text=str(cpu_percent))GUI.after(100, update_label_2) # reschedule to run again after 100msGUI = tk.Tk() # create the top window of a GUIlabel_1 = tk.Label(GUI, text=':o) CPU % :o)') # create a label inside top windowlabel_1.pack() # render the label_1 labellabel_2 = tk.Label(GUI, text='100') # a second labellabel_2.pack()btn = tk.Button(GUI, text='E X I T', command=GUI.quit) # an exit buttonbtn.pack()GUI.after(0, update_label_2) # schedule to call update_label_2 function at first runtk.mainloop() # start the window loopHit Ctrl+F5 to Run it. A window with live processor usage will open.See? It's hard to find an easier language.You are now officially Knight level 14 in Python!

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 08, 2022, 05:09:49 pm
content: I use both Gtk+ 3.0 (in C) and Qt 5 (in Python 3) quite a lot.Both support defining user interfaces in an XML-based language, as.uifiles. In Gtk+, this is done using theGtkBuilderinterface (better old documentation); in Qt, using theQUiLoaderinterface.There are two different Python 3 bindings for Qt5: PyQt5 and PySide2. There exists a compatibility layer,QtPy, which allows an application to use both. A couple of years ago in a different thread here, I showed aminimal implementationproviding the same – i.e., write your Python 3 and Qt 5 code in a way that works with either PyQt5 or PySide2, as long as at least one is installed.Later on in that same thread,I showed an exampleof how to use theuic.pyin the post linked to above, and an .ui file (that one can edit in Qt Designer), to talk to an USB-connected microcontroller on non-Windows machines (because it uses the POSIXtermiosfor the USB Serial).In general, I'm a heavy proponent of the approach of letting end users mess with the User Interface as much as they want, because I myself as an end user want that kind of power. If there is any heavy computation or Secret Sauce, I put it in native code, in a dynamically loaded library, as interfacing to such is easy from Python. And anything but trivial user interfaces are better described using an .ui file; nobody needs the hassle of maintaining code that implements one in the long term!While my code is generally intended to be easily portable across all systems, I do not currently have a Windows machine (or a VM with Windows; Ishouldset one up for exactly this reason!), so they often lack the quirks Windows need. It is not an ideological choice; it's just that I'd rather be ready to write it when needed, instead of guessing and not testing it works, and possibly leading others astray.

author: paul@yahrprobert.com
author_rank: Regular Contributor
timestamp: June 09, 2022, 01:35:29 am
content: wxPython is alive and well and runs under python 3.x nowadays. go towww.wxpython.orgfor details. There are several tools for building a gui such as wxGlade and wxDesigner, though I prefer to write my code by hand using the "sizers" to lay out my widgets. The coolest thing is that it comes with a comprehensive demo package that shows all the widgets and lets you steal code from them to build your own app.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 09, 2022, 06:13:49 am
content: Quote from: Nominal Animal on June 08, 2022, 05:09:49 pmTried Qt some time ago, following your advice here, thanks:https://www.eevblog.com/forum/programming/python-becomes-the-most-popular-language/msg3763337/#msg3763337but I didn't try Gtk because back then I didn't like its general look/graphic design.About Gtk 3, looked at it again yesterday and still don't like it. It's graphic elements seems like Gtk3 was designed for a phone or a tablet. I want something that looks like a desktop GUI, anything between Win95 and WinXP look, or KDE from Linux, would be great. Gtk 2 looks a little better, but still not as nice as KDE, and since now there is Gtk 3, I expect Gtk 2 to be abandoned in the future.In terms of programming easiness, at a brief browsing of its doc pages Gtk 3 looks to me about the same as any other in terms of number of lines per a given goal to achieve, but I wouldn't be able to identify if there are programming advantages when using Gtk3.Given the fact that visually I prefer the Qt/KDE look over Gtk/Gnome, is there any programming advantage to make one choose Gtk3 over something else?Quote from: paul@yahrprobert.com on June 09, 2022, 01:35:29 amNever tried wxPython before, because it seemed abandoned. The latest news in the linked page is from the end of 2020, yethttps://github.com/wxWidgets/Phoenixseems active, with last submit from yesterday.Will test wxPython, too, thanks.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 09, 2022, 09:54:15 am
content: Quote from: RoGeorge on June 09, 2022, 06:13:49 amIf we are talking about programming in Python, no.If we talk about programming in different languages, then Gtk+ is natively C, and Qt C++. Other than that, I find them generally very similar in purpose and approach.With Python 3, I do prefer Qt 5, but the reason has more to do with visuals and availability of documentation (for bothPySide2andPyQt5bindings, noting that the main difference is betweenPySide2's QtUiToolsandPyQt5's uic, which can be bridged with QtPy or the aforementioneduic.pyfrom it) than anything else.That said, there is "Python" documentation for Gtk+, too; namely, theGtk+ 3.0 PyGObject reference. PyGObject is the Python interface to allglib-based libraries: GObject provides introspection files (see/usr/share/gir-*/*.gir; the format is XML-based, so human readable) directly from the C sources, that PyGObject (giPython module,python3-giDebian package) can generate the Python bindings for at run time. That is, you only really need the runtime dynamic library files, the gobject introspection files, and interpreted languages like Python and Perl can generate the bindings for the libraries at run time. Which is nice.If I werealreadyusinggiin Python to interface to some library, I would then choose Gtk+ for the UI instead of Qt. Thus, I guess there are situations where one would find it advantageous/easier to pick one instead of the other, but it really depends on the application one is implementing; and most of all, whatotherlibraries one intends to use.Serial port access is one of those complicated things. I personally am comfortable usingtermiosand low-level I/O (in both C and Python), but it isn't portable (to Windows). The existing serial port Python libraries just can't deal with all possible use cases, and many make inane stupid assumptions (likewrite()syscall on a serial port never failing and never returning a short count) that leads me to trust them as much as I trust snake oil salesmen. (And I cannot write a "better one" myself, because the built-intermiosPython module suffices, and I don't know enough about Windows' serial port shenanigans to design a portable API. Heck, I don't even like using the TTY layer in POSIXy systems for USB Serial, because it slows comms down at USB 2.0 High Speed (480 Mbit/s). It's just easier to switch to USB bulk transfers than to try and get a new character device driver accepted upstream for stuff that already is supported, and only a bottleneck for a few very fast MCUs.)

author: PKTKS
author_rank: Super Contributor
timestamp: June 09, 2022, 01:58:07 pm
content: Nominal placed some interesting points aboutwrappersAll Python and PERL ( not TCL ...) GUIs are wrappers..The only NATIVE GUI builtin in around all these kits surprisingly hits the folks on FPCthe IDEhttps://www.lazarus-ide.org/is a piece of cake and a TurboVision debugger is available.Apart C and C++ there is no excuse to (also consider or) not use PASCALthe pros list is longand the typical whiners claims are just whining ...Paul

author: RoGeorge
author_rank: Super Contributor
timestamp: June 09, 2022, 03:05:00 pm
content: Thanks for the link, there's a big collection there of how each GUI looks like under different OSshttps://wiki.lazarus.freepascal.org/ScreenshotsUsed Turbo Pascal for a while, it's a nice language but I don't remember it as productive as Python. And there is another (unfair) advantage Python has, and that's the abundance of its modules. Because it is so popular, there is an already written module for almost anything you can imagine or need to do from Python.To me software is yet another pair of pliers in the toolbox. I'm an electronist, so all I know is I have to control some device in the lab, or to process a file, etc. and want to see that done. For sure there is also beauty and elegance and quality in software, just that I know too little to notice all that. When one is not a programmer there is only pragmatism, with no fanboy-ism and no attachment when it comes to which language or which software to use. Whatever fits the bill.I've read the above paragraph before posting, and realized I might be a "software sociopath".

author: PKTKS
author_rank: Super Contributor
timestamp: June 09, 2022, 03:20:43 pm
content: Quote from: RoGeorge on June 09, 2022, 03:05:00 pmSurprisingly for anyone w bare minimal PASCAL skills... today FPC offers the FULL *NIX ecosystem already ready ... if you spare some time to fuss around you will find already made wrappers for X11, SQL, Postgres, sqlite, all modern toolkits... TurboVision.. GDB,, and a whole lot more..Impressive amount of progress for a veteran fast stable and predictable language..With bare minimal skills it will be easier and much more robust than PythonReason being: the type safe compiler ... lots of ready units... notraceback shitSupportlargeprojects with any modern GUI andinter operating systemsNo excuses to not have it aroundPaul

author: RoGeorge
author_rank: Super Contributor
timestamp: June 10, 2022, 05:51:00 am
content: There is another interesting GUI called REMI (REMote Interface), which doesn't use any GUI framework. Instead, REMI builds a webpage, and its GUI opens in a web browser. REMI has an embedded webserver and a WISIWYG GUI editor, too. There is a standalone option but I didn't try that yet (standalone as in no web browser needed?).The developer doesn't need to know HTML or other web technology, only Python.https://github.com/rawpython/remihttps://github.com/rawpython/remi/tree/master/editorA web GUI seems very appealing, especially when the Python application will run on a remote SBC, e.g. on a headless Raspberry Pi. I like that.Installed REMI last night and got an error from rhe REMI editor at saving the webgui. It was early AM hours and probably I've missed some steps, will try again this weekend.

author: bd139
author_rank: Super Contributor
timestamp: June 10, 2022, 07:20:54 am
content: Built some large things in wxpython. Can recommend. As for IDE VSCode is where it’s at these days. When I say where it’s at, I mean that there is significant community attention to actually make it a nice place to be.Really though when I build GUI applications these days I tend to build them in Go as an http server and write the UI in HTML/JS. That has the advantage of producing a single cross compiled binary with no dependencies per platform, strong typing throughout, very low footprint. Most importantly it’s actually possible to write a decent test suite against a browser application compared to other solutions.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 10, 2022, 07:36:19 am
content: Quote from: bd139 on June 10, 2022, 07:20:54 amWow. Mind blown.Do you know of a good tutorial where one could follow a hullo world example (and perhaps beyond) without too much install library hell?

author: bd139
author_rank: Super Contributor
timestamp: June 10, 2022, 07:53:35 am
content: Quote from: Ed.Kloonk on June 10, 2022, 07:36:19 amIf you don't want to actually install it you can just write Go here:https://go.dev/play/Download here:https://go.dev/dl/... follow install instructionsHello world:https://gobyexample.com/hello-worldTutorials here:https://gobyexample.comUse VSCode as an IDE and it will automatically install language support, debugger etc.This is NOT a scripting language for reference so expect to do some more legwork to get to the destination. It is also obtuse about doing things correctly. But the destination is less of a shit show than shipping dependency hell with your apps.

author: Karel
author_rank: Super Contributor
timestamp: June 10, 2022, 08:04:06 am
content: Quote from: RoGeorge on June 07, 2022, 10:40:09 amQt is entirely and certainly FOSS. Pick your license: GPL or LGPL at your choice.The fact that they also offer a commercial license doesn't make Qt "less FOSS".If you say that software that's opensource and released under the GPL and/or LGPL isn't FOSS,then many software will not be FOSS like for example the GTK toolkit.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 10, 2022, 08:39:02 am
content: Quote from: bd139 on June 10, 2022, 07:20:54 amThank you, followed your advice and looked at it minutes ago. Though I won't use wxPython because it is based on wxWidgets, which wxWidgets main webpagehttps://www.wxwidgets.orgdisplays a banner with political declarations/sides/opinions/whatever.I don't care and don't want to know who one is with, or against, or how righteous one might be, or not be, I just don't want activism/political endorsed software, no matter who's side it takes, and no matter how much technical merits that software might have.I'm so full sick of any kind of propaganda. Writing code is a part of my tinkering hobbies, and I want to enjoy the time spent with a hobby project. I don't want to be reminded to worry about anything during that particular time frame. That's the whole point of doing a hobby activity: getting a refuge from the worries one might have because of the problems existing in the world, or in the own life. Also, I don't like to be told who's side to take, or to be guilt-tripped for not taking any side, and so on. Got enough propaganda trauma during Ceausescu's Romania, before 1989, and now (in the last decade) propaganda is at unbearable levels again, just like it was back then, except that now it's coming from other ideologies than back then. Same shit, different flavors.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 10, 2022, 08:52:30 am
content: Quote from: Karel on June 10, 2022, 08:04:06 amMy misunderstanding, sorry, and thanks for taking the time to explain. Corrected my post with a text strike through.

author: Karel
author_rank: Super Contributor
timestamp: June 10, 2022, 09:49:53 am
content: Quote from: RoGeorge on June 10, 2022, 08:39:02 amI couldn't agree more.

author: bd139
author_rank: Super Contributor
timestamp: June 10, 2022, 09:58:34 am
content: Everyone has political, religious, social ideologies which are probably incompatible with yours. It doesn't mean we don't have to be in the same room as them. It's best to be objective and focused on the problem you are solving otherwise you will just end up walking round in circles trying to find people who agree with you and being disappointed.I would suggest we keep this focused on technical merit.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 10, 2022, 01:35:22 pm
content: There is this big list of GUI software for Python.https://wiki.python.org/moin/GuiProgrammingAdding it here just for the docs, and because it didn't pop in the previous searches.

author: mag_therm
author_rank: Frequent Contributor
timestamp: June 10, 2022, 02:34:56 pm
content: As with RoGeorge, I am hobby linux user.I have a license for Xojo but it is too cumbersome for a simple GUI.There is a very basic editor called Gtkdialog that is maybe one step up from Zenity and Glade.This is different from the more popular one using C, with a similar name.Gtkdialog allows a persistent window populated with multi controls and tabs and can run as a parent for underlying bash or python scripts etc.It is a bash script with a multiline command written in xml, that defines the window and controls.A limitation is that (as far as I know) there is no way that an external process can update a field until a control action on the GUI.Comms to and from the controls can be done by files, as I use it.With all its limitations (included sparse documentation) I was able to get a job done in short time with no problemsI put up a screenshots recently on the ham forum, here again:https://app.box.com/s/v24an4ea1iiib9jvcpyeh49j9wx0518ishowing the simple layout, across and down in order of the xml lineshttps://app.box.com/s/tf7936ph90rf4vljgbo427sevbtn6i85showing how to get back data from a button press.The best description I found so far:https://pclosmag.com/html/Issues/201408/page07.html

author: PKTKS
author_rank: Super Contributor
timestamp: June 10, 2022, 03:01:03 pm
content: Quote from: RoGeorge on June 10, 2022, 01:35:22 pmnot really .... it is not like that...They are several implementations of the same thing... most of them are wrappers over the same toolkit GTK.. Qt ... Wx... and even Python itself... that just mean that you will have problems to have a sane single wrapped ...reason being...:- unreliable newbie shit over others...- same thing several times instead of a single framework well maintained..- very fast obsolete versions leading to disaster next corner.... you consider a TOOLKIT?First thing on the list is - WELL MAINTAINEDA wrapper? it must be over a solid toolkit done by clever skilled people w/long term sight.Python reached a vast legion of newbies..this result is very problematicyou should avoid these over and over wrappers...Paul

author: bd139
author_rank: Super Contributor
timestamp: June 10, 2022, 03:03:10 pm
content: Ah PKTKS to fulfil those requirements it sounds like you're promoting something well maintained, stable and no wrapping at all. May I recommend win32 and c++

author: PKTKS
author_rank: Super Contributor
timestamp: June 10, 2022, 03:06:25 pm
content: Not at all..Surprisingly as I pointed above... FPC as of today holds the most broad well maintained and supported UNITS (they are really native API calls UNITS not just wrappers) over the main toolkitsGTK Qt Wx Postgres MySQL sqlite.. and dozen others.. like TurboVisionThere is no duplicated efforts ..no traceback shitDefinitively not newbie work ...Just confirm for yourself..Paul

author: bd139
author_rank: Super Contributor
timestamp: June 10, 2022, 03:12:32 pm
content: I've written a fair bit of Pascal over the years. Just no.

author: PKTKS
author_rank: Super Contributor
timestamp: June 10, 2022, 03:21:00 pm
content: Quote from: bd139 on June 10, 2022, 03:12:32 pmI was introduced to PASCAL on an Burroughs mainframe. Later on IBM mainframe...Then over 90s/00s there was a shift to more "FAST/RAD" tools...Nevertheless never really could spare PASCAL..Recently over the last decade.. the progress of Object Oriented PASCAL made me gradually turn over and over to the fast stable and good finish of the whole thing...I am using it today on regular base... My BENCH inventory now is SQLite TurboVision based..and other tools keep being very well ported.. easier than C++Paul

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 10, 2022, 05:51:46 pm
content: Modern Object Pascal is pretty good. You may have myriads of reasons for not using it (the ecosystem, too few potential developers available, very few compilers, not standardized AFAIK, you already have a large code base in other languages and want to reuse it, etc), but if you're a lone developer or a small team for which those points are not a problem, go for it.

author: PKTKS
author_rank: Super Contributor
timestamp: June 10, 2022, 06:01:05 pm
content: Quote from: SiliconWizard on June 10, 2022, 05:51:46 pm... and it has been just like this... since late 70s on the Burroughs...early 80s... IBM..Pretty steady and predictable...Paul

author: MK14
author_rank: Super Contributor
timestamp: June 10, 2022, 06:11:13 pm
content: Quote from: PKTKS on June 10, 2022, 03:21:00 pmDo you really mean TurboVision, or are you actually talking about Free Vision ?https://en.wikipedia.org/wiki/Turbo_Visionhttps://wiki.freepascal.org/Free_VisionFree Vision seems to be the FreePascal (IDE) version.

author: PKTKS
author_rank: Super Contributor
timestamp: June 10, 2022, 06:16:31 pm
content: Quote from: MK14 on June 10, 2022, 06:11:13 pmThat is really FreeVision - which is a more or less direct translation of Turbo Vision.It is faster and more TERM friendly than TurboVision.I do have TurboVision as well but the API is C++ based.FreeVision is a perfect implementation ... a very good work.. all in native PASCALBTW thanks for pointing that...worth mention that although both can run on any term...FreeVision is more easy to set .. VT100 and XTerm are best supportedRXTERM works pretty well on bothActually the IDE is all based on FreeVision with integrated debugger...The FreeVision itself is a 99.999% ported TurboVision PASCAL UNITPaulPS> anyone interested should look for Robert Hohne port of latest Borland TurboVision for UNIXlatest Borland 2.0 was ported and match tvision-2.2.1 (under Robert Hohne rhide)Borland made TurboVision for PASCAL available in TurboPascal 7.0and that implementation seems to be root for FreeVision.. (my opinion based on my use)Both (C++ Robert Hohne ) and PASCAL (from FPC) work pretty fine

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 10, 2022, 06:20:08 pm
content: Ah, but FreeVision is text-based UI only, right?I would call that UI, but not GUI.But you can definitely design GUIs with FreePascal and Lazarus. It's close-ish to Delphi as far as I could tell, but I haven't touched either in ages so I'm not too sure.

author: PKTKS
author_rank: Super Contributor
timestamp: June 10, 2022, 06:34:04 pm
content: Quote from: SiliconWizard on June 10, 2022, 06:20:08 pmFar more than this...TurboVision is a whole DESKTOP SOLUTION from Borland...A TUI Dekstop with streaming object capabilities and several other class goodsin short you can even record your TUI to a file..The whole thing is a marvelous workPaulPS. btw it has also object record and streaming (like dialogs.. records... anything)

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 11, 2022, 05:24:51 pm
content: Quote from: Karel on June 10, 2022, 08:04:06 amAnything and everything in Qt that an application developer can use, definitely. Everything Qt installed in Linux distributions is available under FOSS licenses.However, there is one or two Qt packages that are not licensed under FOSS licenses, and not available in standard Linux distributions. The main one isQt for MCUs, which is only available under a commercial or an evaluation license.I've talked about this in a different thread, but I'll repeat the core points: One can create proprietary Qt applications based on the LPGL license. One will not be required to expose their own source code. Open source applications can use the GPL license, proprietary applications the LGPL license (if they link dynamically to the Qt libraries). The commercial license gives you commercial support.Satisfying the Qt developer community, and the Qt company, is easy: be proud of using Qt in your application, link to qt.io for further information, and abide by the license. If you compile your own distributable Qt binaries, be open about the exact toolchain (including compiler version and library configuration); optimally, you'd provide build scripts that builds them for each target OS and architecture when run in a directory containing the pristine upstream sources. If you do modify any of the Qt sources, you do need to provide your customers with the modified Qt sources too.In short: the language at the web pages may seem scary to those used to very friendly FOSS projects, but that's just marketing. Everything behind that is quite friendly to FOSS developers. And if you are a developer relying on the LGPL license, they aren't hostile, just indifferent: you neither hurt nor help. (But, if you do stuff I mentioned above, you actually do help a bit, at least as an example of doing thingsrightas a completely outside party.)Quote from: Karel on June 10, 2022, 08:04:06 amThe fact proprietary non-FOSS closed-source applications and libraries are explicitly allowed to dynamically link to any LGPL-licensed library/toolkit/framework, can be confusing to those who do not understand the core idea of FOSS: it is not about zero price, it is about end-user freedom.Even the dynamic linking requirement is really about end users: they must be able to recompile or create their own variants of those LGPL-licensed libraries, so that they can have the proprietary non-FOSS application run with those modified/different libraries.This is the reason why so many of the core libraries are LGPL-licensed. (I do not consider LGPL to be a "compromise" that for example theWikipedia LGPL articleclaims, because LGPL fits perfectly well within thefree softwarephilosophy: it is about personal, end-user freedom. After all, it initially wasn't "Lesser GPL", it was "Library GPL". It's just that it depends on the exact library what license is best suited; not all libraries need to or are best licensed under LGPL.)

author: RoGeorge
author_rank: Super Contributor
timestamp: June 11, 2022, 07:46:47 pm
content: No longer than this morning I've tried to install the latest and greatest Qt, which is Qt6, only to realize that there is no Qt6 installer binaries. Then I've bumped into this bloghttps://embeddeduse.com/2020/02/02/less-love-for-foss-qt-users/so it seems the last binary available without a Qt account was Qt5.14, and from that one on, one either has to register on Qt.io, or build from sources.Not sure if I properly understood that, but if it is so, then I'll strike out Qt from the candidates. I understood that I can build from sources without an account, but such a trend still worries me. Whatever needs an online account is a big no for me, will only use such products only if there is no other option.Guess I tried too many GUI frameworks in a too shorter time and probably burned out, because now I'm seriously thinking in just scribbling future GUIs on a piece of paper and manually translate the hand drawings to Tkinter code, or maybe to PySimpleGUI (a simplified wrapper over many possible frameworks, including Tkinter, Qt, etc.) PySimpleGUI has good documentation and many online tutorials.For Tkinter there is this standalone WYSIWYG editor calledPAGE(should work to generate Tcl/Tk, too), but I've tried it only for Python, and it worked. A little too basic, from sourceforge, seems straight from the 90s and not very intuitive for these days, but it kind of works.Meanwhile triedREMI, too. It finally worked but seems an underpowered project, with almost no documentation. Has enough examples, though. Should work on RaspberryPi, too, but didn't try that yet.

author: MK14
author_rank: Super Contributor
timestamp: June 11, 2022, 08:12:06 pm
content: Quote from: RoGeorge on June 11, 2022, 07:46:47 pmI was tempted to mention it, but now you have, I will as well.I also recently tried QT. I had a mini-nightmare of a time trying to install it, because it is so big (like >10 Gig, temporarily needed, just to install itself), and sometimes like 47.5 GB, just to add more stuff to the QT. It tended to be very fussy about how it was installed, and tended to NOT work out of the box.I had to make an account on the QT thing (for this supposedly FREE open source software), rather/very annoying. But if it is included with a version of Linux, you can escape needing a free account.Eventually, I did get it to install and work, by using openSuse, and pre-selecting it to be installed. I think the repositories of a particular Linux, would have a working version, as well.I suspect QT is worthwhile, if a rather big GUI project, or lots of GUIs or professional looking/maintainable GUIs are required.But for hobby, one-off, quick (until you climb its learning curve), things. Other choices, such as FreePascal/Lazarus, may make more sense. But if you're determined to go the Python route, then Pascal maybe isn't for you.

author: Karel
author_rank: Super Contributor
timestamp: June 11, 2022, 08:31:00 pm
content: Quote from: MK14 on June 11, 2022, 08:12:06 pmAbsolutely not. Here you go:https://ftp1.nluug.nl/languages/qt/official_releases/qt/And here is a mirrorlist if you prefer another source:https://download.qt.io/static/mirrorlist/

author: Karel
author_rank: Super Contributor
timestamp: June 11, 2022, 08:34:27 pm
content: Quote from: Nominal Animal on June 11, 2022, 05:24:51 pmThis thread is about a GUI for Python. So, I was clearly speaking about the Qt GUI framework which is FOSS.

author: MK14
author_rank: Super Contributor
timestamp: June 11, 2022, 08:37:21 pm
content: Quote from: Karel on June 11, 2022, 08:31:00 pmYour link says ......QuoteHere:https://ftp1.nluug.nl/languages/qt/official_releases/qt/6.3/6.3.0/OFFLINE_README.txtTL;DRMaybe just the framework itself, QT. Can be downloaded. But if you want their GUI designers, it seems to get harder to obtain, without an account (but can be done, without, with a degree of difficulty).I'm NOT especially familiar with QT, so there may be better/easier ways of doing it.Most free/open source software, can be just used. This QT thing, has left a bad taste in my mouth. Why it has to be so difficult, it puts me off from being involved with QT. Technically speaking it is open source, but in practice, the hoops you have to sometimes jump through for it, can be frustrating.

author: Karel
author_rank: Super Contributor
timestamp: June 11, 2022, 09:55:22 pm
content: Quote from: MK14 on June 11, 2022, 08:37:21 pmNot "maybe", for sure. But you are right about the installers and probably also Qt Designer and Qt creator (the IDE).But you don't need them. I write software with grafical interfaces using Qt for 10 years and the only thing I need is theQt framework (the libraries), a good editor (Kate) and a compiler (GCC).On Linux, programming with Qt is easy. When I want to release a windows version, I fire up a virtual machine and recompileit for windows. No installer, no IDE. I simply download the Qt source and compile the libraries with MinGW-64.Then I compile my program static. That way I don't need to install a gazillion of dll's when deploying my programand I don't risk any version conflicts. The result is an executable with everything needed inside it.

author: bd139
author_rank: Super Contributor
timestamp: June 11, 2022, 09:55:57 pm
content: Qt is why Electron is so popular…

author: MK14
author_rank: Super Contributor
timestamp: June 11, 2022, 10:02:33 pm
content: Quote from: Karel on June 11, 2022, 09:55:22 pmThat makes sense. Maybe using the framework that way, is also more programming language agnostic (yes it would need to change, but not by that much), but you are NOT committed to the actual programming language.Many people say, staying with text based solutions (which is exactly what you just said), is the best way, anyway.

author: Karel
author_rank: Super Contributor
timestamp: June 12, 2022, 06:17:54 am
content: Quote from: MK14 on June 11, 2022, 10:02:33 pmWhen I started to program with Qt, I used Qt Designer, but I didn't like the generated code.For sure it's easier for starters but as with everything, the risk is that you never learn Qt well enough.By te way, the documentation of Qt is the best:https://doc.qt.io/qt-5/reference-overview.htmlWhen I'm programming, I usually have this page open so that I can easily jump to any class/widget:https://doc.qt.io/qt-5/classes.htmlAnd no, I haven't touched Qt6 yet, I stay with Qt5 untill Qt6 is complete and ready for production and when it'sthe default Qt version Linux.

author: Karel
author_rank: Super Contributor
timestamp: June 12, 2022, 06:29:32 am
content: Quote from: bd139 on June 11, 2022, 09:55:57 pmYou are kidding, aren't you?Which software uses electron:https://en.wikipedia.org/wiki/List_of_software_using_ElectronNow let's have a look at Qt:https://en.wikipedia.org/wiki/Category:Software_that_uses_Qthttps://en.wikipedia.org/wiki/Category:Proprietary_software_that_uses_QtAlso, electron is slower and uses more memory than Qt but I guess that's not a problem for hobbyists.

author: bd139
author_rank: Super Contributor
timestamp: June 12, 2022, 06:53:48 am
content: The market is larger than that. There are an order of magnitude more applications behind closed doors. And they’re pushing towards web and electron over native GUI. One thing I have heard is that Qt is complicated to license and expensive to build. Plus there aren’t enough people who can actually do it out there.I’m no fan of electron myself but it’s s viable tech for a good chunk of cases where Qt sat.The largest thing I’ve seen recently was a fintech numerical analysis tool built in Electron and React. The processing was done with an external process which was C++.

author: Karel
author_rank: Super Contributor
timestamp: June 12, 2022, 08:20:18 am
content: Quote from: bd139 on June 12, 2022, 06:53:48 amThat's your opinion only, you don't provide any info.By the way, electron is slower and consumes more memory than Qt.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 12, 2022, 10:37:20 am
content: Quote from: Karel on June 11, 2022, 08:34:27 pmI was agreeing with you, not arguing with you.It is important to be precise about licensing, as there is too much FUD flying around Qt licensing. Describing the Qt package (unrelated to this thread) that is not FOSS, shows the whole picture. As in "the border liesthere, and it is miles away; thus, the claim is quite correct."

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 10:40:21 am
content: Quote from: Karel on June 12, 2022, 06:17:54 amThanks, that's interesting and good to know. Apparently, there is a similar situation (of sorts) between GTK3(+) and GTK4. GTK4 is the latest one, but many things are still GTK3(+).I also find it annoying with systems (but still might use them), which automatically write some of the code for you. On the one hand it makes it fast and easy, but it can adversely affect the source code.So, it is preferable, to be in charge of the source code, and not have some automatic system, make changes to bits of it.Excellent point about the QT's documentation. Many, GUIs, are rather powerful and useful. But are significantly deficient on the documentation side, which can be a real pain in the neck. Especially when starting out with a new (to the programmer/developer), GUI system, or coming back to it, after a long period of doing other things.But also, exactly as you said. While developing with a particular GUI, the quality of the documentation, can easily affect your workflow speed and aggravation factor.TL;DRIt is sad. But GUIs which lack quality/useful/extensive documentation, are (possibly, opinions might vary) best avoided. Certainly the ones which have almost zero documentation and/or what there is, is of rather poor quality, are best avoided. Even GTK, (or so I've heard), suffers from that, because of issues, related to automatically generating the documentation, from the source code. Brought about, especially because of the numerous multiple, language bindings, for GTK (I've read about this, rather than had it as first hand experience).

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 12, 2022, 11:12:22 am
content: Quote from: Karel on June 12, 2022, 06:17:54 amI don't like using code generators at all.I recommend against usinguicto generate the code for the UI, and instead save the designed UI as an .ui file, instantiating it at runtime viaPySide2.QtUiTools.QUiLoader(PySide2) orPyQt5.uic.loadUi(PyQt5).For those interested in this, see e.gthis exampleI posted in another thread a couple of years back.Quote from: MK14 on June 12, 2022, 10:40:21 amDefinitely. There are those who do (use Qt 6 and/or Gtk+4), but since Qt 5 and Gtk+3 work very well for now, there really isn't any reason to "upgrade" yet.Quote from: MK14 on June 12, 2022, 10:40:21 amI don't like those either. I just wanted to point out that although Qt Designersupportsthat, it does notrequireone to generate the source code for the UI. Both Glade (Gtk+) and Qt Designer (Qt) support XML-based user interface descriptions as.uifiles, that can be instantiated at run time.The syntax is sufficiently simple that one can actually write those.uifiles from scratch, too; it isn't much different to writing HTML by hand. More repetitive and verbose, perhaps, especially the<property ...>...</property>stuff needed to set widget properties.Quote from: MK14 on June 12, 2022, 10:40:21 amVery true. For Qt, I use the samedoc.qt.io/qt-5/classes.htmlas Karel mentioned. For Gtk+, I'm still usingdeveloper-old.gnome.org/gtk3/stable/and not the newdeveloper.gnome.org/gtk3/stable/site, as I find the old pages faster to navigate; fewer clicks to find whatever I'm looking at.(I always keep a terminal window open forman -s 2,3functionorpydoc3module.class, or a browser tab open atman7.org/linux/man-pages/ordocs.python.org/3/library/, too. There is no reason to memorise function signatures and other insignificant details, when you can check in a couple of seconds, and avoid bugs likememset(pointer,length,value)– it'smemset(pointer,value,length)–; these kinds of typos are too common already.)

author: Karel
author_rank: Super Contributor
timestamp: June 12, 2022, 12:53:50 pm
content: Quote from: Nominal Animal on June 12, 2022, 10:37:20 amNo offence. I like your contributions here.

author: spostma
author_rank: Regular Contributor
timestamp: June 12, 2022, 07:33:38 pm
content: anybody interested in FreePascal and Lazarus should visit the Ultibo website.Ultibo compiles for (and can run on a) Raspberry Pi, and gives you a full Lazarus IDE with debugging.The compiled output can go on an SD card, and you are ready to run!This is a monolithic system, so all the OS-specific and all rPi-specific functions are written in Lazarus.You can use most USB devices out-of-the-box, and use wired or wireless ethernet.Also CAN drivers are available, and support for many popular peripheral chips.A great project for people loving the beauty of Pascal!Just take a look at this CAN dashboard with 2x HDMI output for a TVR sports car:https://ultibo.org/forum/viewtopic.php?f=9&t=1450

author: eugene
author_rank: Frequent Contributor
timestamp: June 12, 2022, 10:26:40 pm
content: Quote from: RoGeorge on June 11, 2022, 07:46:47 pmTo be fair, in your opening post you asked for something that works like VB5, which was released in 1991.Anyway, I gave PAGE a try and found that it suits my needs well. Like RoGeorge, I sometimes wish for something as simple and easy as early VB. You could put together a good looking interface in just a few minutes, then flesh out the event handlers. Not suitable for sophisticated programs, but often I just want to interface with some instrument or microcontroller, maybe plot a graph, and save some data to a file. VB5 was great for that.I use Python for similar things today, but writing code to define tkinter widgets and use pack... it's simple, but not RAD enough. PAGE makes it RAD enough for me.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 13, 2022, 07:38:58 am
content: About PAGE, on my desktop the Ctrl+Z does strange things, not really undo-ing, sometimes the graphic WYSIWYG is not synchronized with the tree view of the same elements, selecting more than one element (middle mouse) is not very intuitive (click and drag around elements doesn't select all the enclosed elements, things like Shift or Ctrl alterators behaves unexpected when used for selection, etc.), doesn't do multi-edit of the same property, things like that.I'm not sure if those are bugs, or if it's the expected behavior, but certainly PAGE is not as intuitive as VB5 was. PAGE works, but not very smooth, even if it were to judge it by the 90's standards.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 13, 2022, 07:48:37 am
content: Quote from: RoGeorge on June 13, 2022, 07:38:58 amDo you mean in the app design/widget placement stage or running the generated code?

author: RoGeorge
author_rank: Super Contributor
timestamp: June 13, 2022, 08:14:08 am
content: Talking about the WYSIWYG editor, the quirks while you edit how your Python GUI will look like. PAGE has a Drag&Drop editor, and when you are happy with your future GUI look, it can generate Python code to be edited later for adding functionality to the designed GUI.Also it was not possible to move an element in the tree, for example to just drag a button from outside to inside of a labelframe. Such a change can still be done by copy/paste then deleting the original, but only with one element at a time. So if you want to add later a labelframe around a group of GUI objects you have to copy/paste them one by one inside the new labelframe.Also the alignment appears missaligned sometimes, even when the snap to grid is enabled, things like that

author: bd139
author_rank: Super Contributor
timestamp: June 13, 2022, 08:23:52 am
content: Ugh I'd rather use WPF than deal with that sort of stuff

author: Karel
author_rank: Super Contributor
timestamp: June 13, 2022, 09:06:02 am
content: Ncurses!

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 13, 2022, 11:31:58 am
content: +1

author: eugene
author_rank: Frequent Contributor
timestamp: June 13, 2022, 02:35:56 pm
content: Quote from: RoGeorge on June 13, 2022, 07:38:58 amAh, okay. I didn't run into those things, but likely because I didn't try to do the things you did. I ran through the first tutorial without incident, then put together an interface for a simple file sync program usingalmostthe same process.You're right, behavior like that is hard to tolerate. I'll still be on the lookout for something better, but may continue to use PAGE to build interfaces initially. That's the usual workflow anyway, isn't it? Design/create a GUI then fill in the functionality. With VB5 (and VB.NET and C# in VisualStudio) you can make changes to the interface as you discover the need. With PAGE (even without the intolerable quirks) it's not that simple, but I did find it useful for the first step of building the GUI. Maybe if I'd experienced the same frustration that you did then my attitude would be different.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 13, 2022, 03:36:15 pm
content: It would be interesting to create a simple example Python 3 program using the various toolkits (Tkinter, Qt, Gtk+ at least), comparing the implementations and especially the maintainability, written with long-term maintainability and customisation in mind. That would be very informative, I think, for everyone interested in the subject.I personally am most interested in the ways an external (XML-based text) file is used to define the user interface, as opposed to implementing it in code. For tkinter, one can usepygubuandpygubu-designer; Glade for Gtk+, and Qt Designer for Qt.Serial port access and serial device enumeration is a "problem", because the various existing libraries used for this are, uh, "deficient". So, it'd have to be something more local. Python does have built-in support for CSV files, JSON data, various configuration file formats (including .INI-type files), network sockets and TLS encryption, and evenWAVfiles. Numpy and Scipy have all kinds of FFT and such support, so maybe something to do with those would be useful? I've already done a simpleFinite Impulse Filter response analysistool as an example of completely standalone single-file HTML+CSS+JavaScript browser tool.It'd have to be something actually useful, as to properly "stress" the toolkits/frameworks, and see what working with the codebase and resource files is like. I just cannot think of a suitable example. Even better if someone designs a suitable UI in pygubu-designer/Glade/Qt Designer, or even just e.g. Inkscape as a picture, to start with.

author: Bud
author_rank: Super Contributor
timestamp: June 13, 2022, 04:13:54 pm
content: Given Python's shitty backwards compatibilty, this may be a useless exersize. This may work for a specific version but become broken once a new version is out.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 13, 2022, 04:23:05 pm
content: Quote from: Bud on June 13, 2022, 04:13:54 pmAside from Python 2 to 3, which was annoying as all hell but carefully controlled and not a surprise to anyone, I haven't been bitten by that at all. Exactly what are you referring to?And do note, I am not particularly fond of Python. I use it only because it currently fits my use case – portable interpreted language suitable for user interface implementation, with an easy interface to native libraries – better than the alternatives. It is just a tool for me, and I use it as such. Thing is, I want others to have multiple tools in their kit, and choose the one they use based on the problem/task at hand; and Python only where it is appropriate. Thus, an actual real life example is much more useful than this kind of discussion, in my opinion.

author: Bud
author_rank: Super Contributor
timestamp: June 13, 2022, 04:36:28 pm
content: Carefully controlled?"Python version incompatibilty is intentional" - When such statements come out right from the horse's mouth (Guido van Rossum, the creator of Python), that makes you think.

author: bd139
author_rank: Super Contributor
timestamp: June 13, 2022, 05:58:49 pm
content: I’ve had about 15 million lines of it in production before. Not one issue. Even the python 2 to 3 port was smooth.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 13, 2022, 06:01:39 pm
content: Quote from: Bud on June 13, 2022, 04:36:28 pmIt applied to the 2-to-3 thing. I'd rather have a rewrite/redesign/refactoring, than live with a sub-par design. Now that they know how painful it is, how likely do you think it is they repeat it?EvenPerl 7intends to fix defaults that are no longer applicable, somewhat "breaking" backwards compatibility. Although I do realize first-hand how painful all backward compatibility breaking changes are, I still think they are good/important/preferable in the long term.Programming languages are just tools, after all.In any case, if someone comes up with a good idea for a basic but useful GUI example program, especially if they bother to design/sketch out the UI, I do promise totryto write at least Qt (PySide2 + PyQt5) and Gtk+ (gi) implementations (on Linux, as I cannot currently test on Windows), perhaps also a tkinter/pygubu one. (The "try" is there, because I'm still struggling with productivity/responsibility/stress management failures, and cannot promise I don't stumble on those personal pitfalls I tend to stumble on.)

author: Bud
author_rank: Super Contributor
timestamp: June 13, 2022, 06:25:53 pm
content: Quote from: bd139 on June 13, 2022, 05:58:49 pmGood for you. Total opposite experience here.

author: Karel
author_rank: Super Contributor
timestamp: June 13, 2022, 07:16:11 pm
content: When you report a problem on a forum related to one of the bigger python projects,the first thing they ask you is which version exactly of python you are using.Then they tell you to try version 3.xyz instead of version 3.xzy...

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 13, 2022, 09:20:13 pm
content: Quote from: Karel on June 13, 2022, 07:16:11 pmI've done that in C projects also, for the simple reason that if there has been a lot of churn in that part of the code base between the two versions, having information in which version the behavioural change occurred, tells a lot about what code might cause it. Hell, this is exactly whygit bisectexists: it is how bugs and behavioural changes in the Linux kernelare pinpointed.In other words, it is an useful buggy code locating technique. Please, do not think it is a way to just divert you to a new version! I have never done that with the intention of having the end user switch to a newer version, only as a tool to pinpoint the source code involved! I know what kind of hell version dependencies can be, firsthand.Only when they refuse to fix the issue because it does not occur in a later version, does it actually become assholey behaviour.Also, even if Python developers were to refuse to fix the issue (for example, for 3.8.x because the bug is not a security issue), Linux distribution maintainers often will, applying bug-fixing patches at the distribution level. In general across many projects, sane upstream developers then relent, and release a bugfix anyway.Why Python 3.8.x as an example? It is listed as "security fix maintenance only", but 3.8.x is currently shipped in e.g Mint 20.3 (Long Term Support) and other Debian/Ubuntu derivatives. I personally am currently using 3.8.10 myself, even though 3.10.y is the Stable and 3.11.z the Development version right now (2022-06-13).

author: nctnico
author_rank: Super Contributor
timestamp: June 13, 2022, 09:37:37 pm
content: Quote from: Nominal Animal on June 13, 2022, 03:36:15 pmThe latter is a good option. Draw a layout as a mock-up and code it. I've let go of the idea of using GUI design tools a long time ago. You quickly want your controls & screens to scale which is easy to do in code but very hard with controls that just sit there at a fixed position. And creating a bunch of contols using a for loop is quicker too and the spacing & position can be changed much quicker compared to using a GUI design tool and adjusting the position of every button, text, etc.

author: nfmax
author_rank: Super Contributor
timestamp: June 13, 2022, 09:43:54 pm
content: Quote from: Nominal Animal on June 13, 2022, 06:01:39 pmOddly enough, I had occasion to make just such a tool a few months back. It's a 'data inspector' for signals from an ultrasound system whose purpose it is inconvenient to go into too deeply here. Suffice it to say, the development engineers were having a hard time using the application software, which does some fancy signal processing and presents measurements derived from this processing, to decide if the system was actually working as designed or not.So I put something together in Python (since rest of the software is in Python) using PyQt5, numpy, scipy & matplotlib. It shows a tabbed interface that lets you look at a signal in the time domain or as a spectrogram, or a whole set of such signals together as an echogram (i.e. like a medical ultrasound image). With features like optional harmonic cursors in the spectrogram, time/frequency/range cursor readout in lots of different modes, and lots of control over the visualisations to bring out different features (or bugs). It's been highly revealing. Also handy to make pretty pictures to show the investors!I started using the Qt visual designer, but in the end I kept it only for the menu structure. The rest of the interface I just wrote by hand in Python. It uses the 'springs and struts' approach which I am familiar with from ancient history. This leads to a huge __init__() method for the View object, which is inconvenient to work with. It's also a bit hairy keeping track of the slot/signal connections, since that can only really be done by the Controller. You end up having to modify two separate parts of the code for each change or addition to the UI. It's not the old VB click & code approach. But the View & Controller are both really too large & unwieldy for comfort and should be split up somehow. I didn't really try, but Qt doesn't seem to offer any help with that.One unexpected nice feature was PyQt's threading support. It made keeping the interface live while loading data from a directory containing some hundreds of CSV files quite easy to accomplish. Complete with progress bar and cancel button!Now we are gaining confidence in the system, the inspector is seeing less use, but it still scratches a significant itch. No thoughts of reworking it using another GUI toolkit though, and I can't disclose the codeBut perhaps it may inspire someone else

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 14, 2022, 06:04:11 am
content: Quote from: nctnico on June 13, 2022, 09:37:37 pmFor what it is worth, I tend to use GtkGrid or QGridLayout for widget layout, much like HTML tables, which scale automatically. I basically never use fixed layouts, as Ineedmine to scale according to my varying needs.I lived through the"This web site is best viewed in 800x600 resolution"era, and hated every time I encountered that. I didn't do it myself then, and I don't want to do it now. I habitually browse web sites with varying (site-specific!) zoom levels, too. (Right now, for EEVblog forums, on this particular laptop I use 120% with 14pt DejaVu Serif as default font. For other sites, it varies between 90% and 133%. It obviously also varies depending on the display I'm using, and the distance I am at from the display.)Quote from: nctnico on June 13, 2022, 09:37:37 pmTrue. It really depends on the application, which is my point regarding an example. A synthetic example won't be useful much; we really need a real-world use case for it to matter.GtkBuilder does support<template>.ui objects in Gtk+ 3.10 and later, and in both Gtk+ and Qt .ui files you can generate objects (and object hierarchies) and instantiate them multiple times, but I prefer to create Python classes (possibly extending a suitable toolkit widget class) instead. And I have a habit of describing things in dictionaries (in Python; in arrays of structures in C) and instantiating them in a loop.Whatever makes the code most maintainable, but does not have any significant downsides (like slowdowns or installation quirks), is the best approach in my opinion.Quote from: nfmax on June 13, 2022, 09:43:54 pmWell, visualising signals and filters in time and frequency domains is an important tool in many sub-fields members here would be interested in.Quote from: nfmax on June 13, 2022, 09:43:54 pmWhen using Qt Designer.uifiles, PyQt5.QtCore.QMetaObject.connectSlotsByName auto-connectson_widgetName_signalNameslots to the named signals. Applying the Principle of Least Surprise, we can do that ourselves with just a couple of lines.Let's assume we use a custom class, with the widget hierarchy already hanging off theuimember. (I load this usingself.ui = loadUi("filename.ui"), but it does not matter how you construct it, as long as you usewidget.setObjectName("widgetName")or equivalent to give each signal-generating widget an unique name.)Connecting all abovenamed functions in the custom class to proper signals requires just a few lines of code, after theself.uiwidget hierarchy has been created (but not shown yet):for slot in dir(self):if callable(slot) and slot.startswith("on_") and slot.find("_", 3) > 3:widgetName, signalName = slot[3:].split("_", 1)signal = getattr(self.ui.findChild(QtCore.QObject, widgetName), signalName, None)if signal:signal.connect(getattr(self, slot))Alternatively, you can use an array of("widgetName", "signalName",pythonCallable)tuples, and in a loop over them,sourceSignal = getattr(self.ui.findChild(QtCore.QObject,widgetName),signalName, None)if sourceSignal is not None:sourceSignal.connect(pythonCallable)To include signal-to-widget-slot tuples of form("sourceWidgetName", "sourceSignalName", "targetWidgetName", "targetSlotName"), dosourceSignal = getattr(self.ui.findChild(QtCore.QObject,sourceWidgetName),sourceSignalName, None)targetSlot = getattr(self.ui.findChild(QtCore.QObject,targetWidgetName),targetSlotName, None)if sourceSignal is not None and targetSlot is not None:sourceSignal.connect(targetSlot)instead.I find these "tricks" make the signal-slot stuff much more maintainable.