Forcing myself to start programming in Python was like pulling teeth. But, once started, it took about 1 hour. I will assume you’re skilled enough with programming C++ and minimally-skilled with Python.
Comparing Python to C/C++, Java,…etc: Programming in various languages is about the same - the main difference is the Syntax.
Meaning all the stuff like Loops, Conditional’s, etc… is mostly the same/similar - it’s mostly the words you use…
Thus, if you know C++, You can become a Python programmer very quickly by reviewing some Python codes, Kicad plugins (and a few tutorials online). That’s how I converted my programming knowledge and was able to quickly make KiCad Python plugins and Stand-Alone App’s to manipulate Kicad files (Kicad is human readable text).
Quick example below shows reading a Kicad PCB file. Naturally, once read, you can manipulate and do whatever with the data…
Note: I use wxFormBuilder to build the GUI (FYI - formbuilder can generate C++ GUI code (if desired). Screenshot below). The code for the GUI stuff is in a separate for cleaner programming.
The Content reader/lister is called from a Kicad Plugin (green Icon in video). I used quickly made minimal circuit for the example (thus, minimal list of contents to read…)
Also, if you really don’t want to do most of the programming in Python, build a C++ Executable App and Run it from a Kicad Plugin. Easy to do (one line of code to run it).
FYI - You’re skilled enough to discover for yourself the various differences in Python’s ‘Print’, String_Tools and other output’s. And, their differences in how the desired data is pumped out…
It took some demo coding to get a handle on it and I offer a glimpse of only a couple of items. Worth noting the various String manipulations and how they handle NewLines…
My example (vid) shows Newlines between lines because that’s how I wanted them. But, ‘No’ Newlines is easy… If you look at Kicad’s files, you see they do Not contain Newlines between lines.