May-19-2022, 07:52 AM
Yes my goal is to override a method. The method is into a python script which is "delivered" via PyInstaller into a binary .so suite of files:
I cannot understand well the import doc: https://docs.python.org/3/reference/impo...portsystem
It may appear that importing .so "shared libraries as they call" is possible but I did not find how.
thanks for helping,
Pierre
Quote:paolipie@gnbsx26072:/<4>users/paolipie/python/py_workdev/invest_overwritte_func/> ll ../create_deliverable/dist/invest/
base_library.zip invest* _random.cpython-37m-x86_64-linux-gnu.so*
binascii.cpython-37m-x86_64-linux-gnu.so* libbz2.so.1* readline.cpython-37m-x86_64-linux-gnu.so*
_bisect.cpython-37m-x86_64-linux-gnu.so* liblzma.so.5* resource.cpython-37m-x86_64-linux-gnu.so*
_blake2.cpython-37m-x86_64-linux-gnu.so* libpython3.7m.so.1.0* select.cpython-37m-x86_64-linux-gnu.so*
_bz2.cpython-37m-x86_64-linux-gnu.so* libreadline.so.6* _sha1.cpython-37m-x86_64-linux-gnu.so*
_codecs_cn.cpython-37m-x86_64-linux-gnu.so* libtinfo.so.5* _sha256.cpython-37m-x86_64-linux-gnu.so*
_codecs_hk.cpython-37m-x86_64-linux-gnu.so* libz.so.1* _sha3.cpython-37m-x86_64-linux-gnu.so*
_codecs_iso2022.cpython-37m-x86_64-linux-gnu.so* _lzma.cpython-37m-x86_64-linux-gnu.so* _sha512.cpython-37m-x86_64-linux-gnu.so*
_codecs_jp.cpython-37m-x86_64-linux-gnu.so* math.cpython-37m-x86_64-linux-gnu.so* _socket.cpython-37m-x86_64-linux-gnu.so*
_codecs_kr.cpython-37m-x86_64-linux-gnu.so* _md5.cpython-37m-x86_64-linux-gnu.so* _ssl.cpython-37m-x86_64-linux-gnu.so*
_codecs_tw.cpython-37m-x86_64-linux-gnu.so* _multibytecodec.cpython-37m-x86_64-linux-gnu.so* _struct.cpython-37m-x86_64-linux-gnu.so*
_datetime.cpython-37m-x86_64-linux-gnu.so* _opcode.cpython-37m-x86_64-linux-gnu.so* termios.cpython-37m-x86_64-linux-gnu.so*
grp.cpython-37m-x86_64-linux-gnu.so* _pickle.cpython-37m-x86_64-linux-gnu.so* unicodedata.cpython-37m-x86_64-linux-gnu.so*
_hashlib.cpython-37m-x86_64-linux-gnu.so* _posixsubprocess.cpython-37m-x86_64-linux-gnu.so* zlib.cpython-37m-x86_64-linux-gnu.so*
_heapq.cpython-37m-x86_64-linux-gnu.so* pyexpat.cpython-37m-x86_64-linux-gnu.so*
I cannot understand well the import doc: https://docs.python.org/3/reference/impo...portsystem
It may appear that importing .so "shared libraries as they call" is possible but I did not find how.
Quote:5.5. The Path Based Finder
As mentioned previously, Python comes with several default meta path finders. One of these, called the path based finder (PathFinder), searches an import path, which contains a list of path entries. Each path entry names a location to search for modules.
The path based finder itself doesn’t know how to import anything. Instead, it traverses the individual path entries, associating each of them with a path entry finder that knows how to handle that particular kind of path.
The default set of path entry finders implement all the semantics for finding modules on the file system, handling special file types such as Python source code (.py files), Python byte code (.pyc files) and shared libraries (e.g. .so files). When supported by the zipimport module in the standard library, the default path entry finders also handle loading all of these file types (other than shared libraries) from zipfiles.
thanks for helping,
Pierre