Learning PyQt

One of my recent undertakings has been, to extend my knowledge of Python, which I was previously only capable of writing procedural code for, to include, how to write Object-Oriented Python.

In the process, I began to think of what advantages I might now have, with that ability. And one answer which presented itself was of the form, ‘I already know enough about the Qt Library, to use it for some C++ programs. It has a Python binding referred to sometimes as PyQt. With the ability to write Object-Oriented Python, I should also gain the ability to write GUI applications in Python – eventually.’

The result of my recent exercise can be found at this URL:

https://dirkmittler.homeip.net/binaries/

The compressed files which contain my first project using PyQt are named ‘PyQt_Test_1_s.gz‘ and ‘PyQt_Test_1_s.zip‘. Either of those compressed archives need to be unzipped to a folder, in which there should be a total of 4 Python scripts. Python 3 would need to be run on the script named ‘AppStart.py‘.

I’m sorry to start so small.

Oh, yes… In order for these scripts to run, the reader’s Python installation would need to include PyQt5. Not all do.

Dirk

An example of something, which isn’t AI.

One of the behaviours which has been trending for several years now, is to take an arbitrary piece of information, and just to call it AI.

This should not be done.

As an example of what I mean, I can give the following image:

frame_000010_c_1

This is an image, which has been palletized. That means that the colours of individual pixels have been reduced to ‘some palette of 256 colours’. What any conventional software allows me to do – including ‘GIMP’ – is next, to assign a new colour palette to this image, so that all these colours get remapped, as follows:

frame_000010_c_2

What I could do – although I won’t – is claim somehow that this has ‘artistic merit’. But what I cannot legitimately do is, to claim that the second image is ‘an example of AI’.

(Updated 7/06/2021, 16h30… )

Continue reading An example of something, which isn’t AI.

An exercise at converting an arbitrary video clip into ASCII-art.

One of the throw-back activities in Computing, which has existed since the 1990s, was so-called ‘ASCII-Art’, in which regular characters represented an image.

When this form of Art is created by a Human, it can look quite nice. But, if a mere computer program is given a sequence of images to convert into characters in a batch-process, the results are usually inferior, because all the program will be able to do is, to translate each cell of the images to an ASCII character, the brightness of which is supposed to represent the original brightness of the cell of the image. The complex shape of the actual text characters is not taken into account – at least, by any programs I have access to – and will also interfere with the viewer’s ability to recognize the intended image, because those shapes will just represent some random ‘noise’ in the image, without which, merely to have been given grey-scale tiles would have probably made it easier for the viewer to recognize the image.

In spite of recognizing this, I have persevered, and converted an arbitrary video-clip of mine into ASCII-art, programmatically. The following is the link by which it can be viewed:

(Link within my Web-site.)

And Yes, the viewer would need to enable JavaScript from my site, in order to obtain an actual animation, because that is what advances the actual ‘iframe’.

 

(Updated 6/26/2021, 14h45… )

Continue reading An exercise at converting an arbitrary video clip into ASCII-art.

Improvement in my ability to compile code.

One of my practices on this blog has been, to compile certain programs for use either under Linux or Windows, depending on which compiled binary gets used by my reader, to sign any Windows .EXE Files, but only to be able to generate such Windows executables, if they did not have a GUI – i.e., if they were meant to be used in text-mode only, from a Windows command-prompt.

One reason for this has been, the fact that I was teaching myself the Qt5 GUI library, which is cross-platform, but which requires software beyond Visual Studio to compile on the Windows platform I’ve been using, just for such projects.

Ideally, I’d be able to write a Qt5 application once, and then compile it separately, for use under Linux or Windows, and on top of that, to put my code signature on the Windows executable.

Well, I’ve gotten closer to this objective, by means of brute force. I’ve installed the Qt SDK for Windows, in a way that parallels my installation of Qt development packages under Linux. I am able to transfer the source code, and then compile it on the other platform.

Once again, the URL at which my list of potential binaries resides, is:

https://dirkmittler.homeip.net/binaries/

And the 4 new additions, which did not previously have Windows executables within, are:

  • ‘Creator_Test3.tar.gz’
  • ‘Creator_Test3.zip’
  • ‘Dirk_Roots_GUI_1.tar.gz’
  • ‘Dirk_Roots_GUI_1.zip’

 

Enjoy,

Dirk