3 ms·
My way to work around this is to make a zipapp that contains several files, hence the entry point can do the checking and import another file that contains the
by BiteCode_dev 5y ago
My way to work around this is to make a zipapp that contains several files, hence the entry point can do the checking and import another file that contains the code. But since its a zipapp, it behaves like a single file script: https://docs.python.org/3/library/zipapp.html https://docs.python.org/3/library/zipapp.html
Nowaday, I use shiv to produce the zipapp:
https://shiv.readthedocs.io/en/latest/ https://shiv.readthedocs.io/en/latest/
It's handy because you can also now embed 3rd party dependencies, even for small quick scripts if you wish.