What does this mean for static communication and dynamic communication in Python?

I know the difference between static and dynamic communication in C or C ++. But what does this mean in Python? Since this is just an interpreter and has only one style of the module import mechanism, how does it make sense?

If I freeze a Python application using cx_freeze, excluding a specific library, is this some kind of dynamic linking? Because users need to download and install this library on their own in order to run my application.

Actually my problem: I am using the PySide library (with LGPL v2.1) to develop a Python GUI application. The library says that I should dynamically link to the library in order to obey their legal terms (the same as Qt). In this case, how can I dynamically communicate with PySide?

+6
source share
1 answer

There is no static binding in python. All imports require the correct dependencies to be installed on our target machine. The choice of version of such libraries is in our solution.

Now let's move on to the binary builders for python. In this case, we will need to determine the type of binding based on the GNU definitions. If the user can replace the dependency as he likes, it is dynamic. If a dependency is attached along with the binary element itself, this is a static binding. In the case of cx_freeze or pyinstaller, if we create it as a single file, this is a static binding. If we build it in normal mode, where all the dependencies are collected as separate files, this is dynamic linking. The idea is whether we can replace the dependency on the target machine or not.

0
source

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


All Articles