How to find Python executable?

Note that Ubuntu (and most GNU/Linux distributions for that matter)
often patches the versions of the software they distribute in order
to make them meet the distribution’s specific system policies or to
backport fixes for critical bugs. If you want the exact source code
Ubuntu used to build their packages, you need to learn about the
tools in that distribution for retrieving and unpacking “source
packages” with their patches auto-applied.

A quick web search turned up a fairly accurate (if slightly dated)
blog post, but if you hunt around I’m sure Ubuntu has their own
guidance, or if you find any from Debian it will be 99% identical
too:

Welcome to the internet. Some of us like to socialise. If you want to keep it specific, link to the particular repo you’re having trouble with from the start, instead of starting abstract discussions.

I’m still not convinced you’re actually managing to compile it at all. Like many projects, this one assumes you have compiler tools like autogen and cython and gcc already installed. Have you tried following the repo’s own installation instructions, instead of relying on PyCharm?

Or if you look in their own CD configuration, you will find the exact commands they run themselves before each release. Have you tried those (in a Ubuntu 22.04 container)?:

sudo apt-get update
sudo apt-get install -y -qq --no-install-recommends automake autoconf libtool autopoint gettext cython3 libglib2.0-dev python3-dev python-gi-dev libbluetooth-dev
CYTHONEXEC=cython3 ./autogen.sh
CYTHONEXEC=cython3 make distcheck

OK, I will socialize,
From get go - I stated before - I am NOT a fan of Python… This is a second “python” code I am having issues running… Yes,I use PyCharm and my first project actually runs , but not “Bluetooth manager”:… My biggest issue is understanding how pure Python code is integrated with GUI…and since this app is mixing C code it is even worse to navigate. Do not get me wrong, each single task is performed , but as a whole the “:manager” is really not what I need… I need to have a bluetooth code which sets up a task and monitors the response ,and that is NOT what “manager” does. So - essentially I was hoping to extract ONLY the code I need, but that seems to be more time consuming than expected… I guess I will go back to “hci” after all that is what BlueZ does.

More social , just for laughs

My first program, I got $ for , was based on “ANSI C”.

Judging from this discussion, there is no such thing as “ANSI Python” and

“main” ( anything) in application is also a thing of the past.

so “Inmates are (still) running the asylum”

1 Like

Haha! C and Python have got quite similar design philosophies - they both give you more enough rope to hang yourself with. Just on different levels.

ANSI C was still developed into C95, and then C99 etc. etc. If even the C standard has to be revised every 5 years…

Standardisation is valuable for languages with single corporations backing them (e.g. C# and Java), and has ensured C has a healthy choice of compilers (and by standardising JS, we all have a healthy choice of web browsers). But even within those choices, the range of different libraries, platforms/targets, compiler flags, and build tools means that it was only ever possible for standardisation some of the compatibility problems.

The alternative Python compilers and interpreters to the reference implementation (CPython) all tend to implement their own language subset and their own extensions (PyPy, Cython, IronPython, Jython, Mojo and Micro & CircuitPythons etc). Lack of ISO accreditation isn’t the thing (if there is any such thing) that’s holding them back.

By the way, main functions are still really common. There’s a wide spread idiom of if __name__ =='__main__' to guard script only code, and main is the obvious thing to name the primary entry point. And if the program returns 0, the main function really ought to return 0 too.

Thanks, I guess a minor detail - the app is allegedly written in Python… not really - it is written in CPython and PyCharm is therefore wrong tool…
I think there is still a slim chance it will work for me…

Thanks, I guess a minor detail - the app is allegedly written in
Python… not really - it is written in CPython and PyCharm is
therefore wrong tool… I think there is still a slim chance it
will work for me…

You may be confusing CPython (the reference implementation of an
interpreter for the Python language) and Cython (a Python-like
language designed for translating into C source code).

1 Like

The project is nearly entirely Python code (30K LOC of Python with a few hundred LOC of Cython and C), but has an extremely unusual and (IME) unique project / build structure. PyCharm is probably only going to be useful as a basic syntax highlighting editor, since it is not going to understand the project configuration.

As an example, there are a half dozen “main checks” that @JamesParrott mentioned (so, a half dozen separate applications in this one repo!) but they are not exactly in Python modules. Instead they are in template files that get turned into Python modules at some point in the build process. As I said, this is all very non-standard for typical Python projects.

bk320-py311 ❯ rg "__main__"
apps/blueman-sendto.in
136:if __name__ == '__main__':

apps/blueman-applet.in
19:if __name__ == '__main__':

apps/blueman-adapters.in
20:if __name__ == '__main__':

apps/blueman-services.in
22:if __name__ == '__main__':

apps/blueman-tray.in
18:if __name__ == '__main__':

apps/blueman-manager.in
19:if __name__ == '__main__':

As I said, this is all very non-standard for typical Python projects.

…and it took (ME) few days to realize this…

Which leads me to say this - and it probably gets me banned … this "Blueman " app appears to be a private exercise in “job security” - “I can code this way …” and NOBODY can see how I did it…and how it actually works…

As I said , I am not a Python fan, and more I dabble in it the more I am convinced it is bad choice of coding language - it appears not to be intended for GUI application, then GUI is always “klugged in” …

@anneranch Any project of sufficient age will end up with “historical baggage” and that goes extra for projects that have more specialized requirements around hardware or other languages. It’s frankly just really weird to jump to a conclusions about malicious intent.

As I said , I am not a Python fan, and more I dabble in it the more I am convinced it is bad choice of coding language - it appears not to be intended for GUI application, then GUI is always “klugged in” …

Good luck, agree to disagree I guess :person_shrugging:

2 Likes