Can you use PyCrypto with py2exe? Can you use any arbitrary library for that matter with py2exe?
Thanks, Chris
I have yet to find anything that py2exe can't actually handle, though from time to time it has lagged developments in Python itself. (For example, for a while it had trouble with the new absolute imports stuff, though I believe that's been resolved. It also wasn't so good with eggs, but I don't know if that has been resolved.)
I don't see why you'd have any problem using it with PyCrypto either, as that package has nothing special in it compared to many others that work fine. It's a bunch of pure Python plus a handful of .pyd files, and certainly py2exe deals well with those. Here's an example, using code pulled from the PyCrypto site:
from Crypto.Cipher import DES
def main():
obj=DES.new('abcdefgh', DES.MODE_ECB)
plain='Thvqb ina Ebffhz vf n fcnpr nyvra.'.encode('rot13')
ciph=obj.encrypt(plain+' ' * 6)
print obj.decrypt(ciph)
if __name__ == '__main__':
import sys
if sys.argv[1:] == ['py2exe']:
from distutils.core import setup
import py2exe
setup(console=[dict(script='script.py')],
options={'py2exe': {'excludes': ['Tkinter'] }})
else:
main()
Save as script.py
, build using script py2exe
, and run with dist\script
to see some output.