python can load modules from remote server?
in py开发者_如何学Gothon,can i load a module from remote server to local? what i do this is want to protect my source code. what should i do ,thanks
it can be done via python import hooks. see knockout for an implementation that you can either use directly or as a starting point to add further code-protection logic
A bit off topic but if source protection is what you need C-compile your python source with cython and distribute .pyd files.
You'll have to:
- adapt your source to be cython compilant (not all code can be converted)
- precompile .pyd files for platforms you want to support (Windows, Ubuntu, Fedora etc...)
Yes, you can import your code in creative ways.
No, it will not protect the code from being seen. Rethink your strategy, not tactics.
精彩评论