obfuscation - Is there a way to combine a python project codebase that spans across different files into one file? -


the reason want want use tool pyobfuscate obfuscate python code. butpyobfuscate can obfuscate 1 file.

i've answered direct question separately, let me offer different solution suspect you're trying do:

instead of shipping obfuscated source, ship bytecode files. these .pyc files created, cached, , used automatically, can create them manually using compileall module in standard library.

a .pyc file .py file missing can imported fine. it's not human-readable as-is. can of course decompiled python source, result is… same result running obfuscater on original source. so, it's better you're trying do, , whole lot easier.

you can't compile top-level script way, that's easy work around. write one-liner wrapper script nothing import real top-level script. if have if __name__ == '__main__': code in there, you'll need move function, , wrapper becomes two-liner imports module , calls function… but that's hard gets.) alternatively, run pyobfuscator on top-level script, really, there's no reason that.

in fact, many of packager tools can optionally of work automatically, except writing trivial top-level wrapper. example, default py2app build stick compiled versions of own modules, along stdlib , site-packages modules depend on, pythonxy.zip file in app bundle, , set embedded interpreter use zipfile stdlib.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -