My problem is the follow: I have installed pyCrypto in my computer. Then when I execute a script the intepreter say this:

from: can't read /var/mail/Crypto.Cipher
./entrega2.py: line 2: syntax error near unexpected token ('
./entrega2.py: line 2: obj=DES.new('abcdefgh', DES.MODE_ECB)'

It can't read from Crypto.Cipher. However if I execute the intepreter of python, then I can do this:

from Crypto.Cipher import AES

This sentence in the intepret runs but in a file not. I don't know why.

Sorry because my english is very bad and my skills low.

Can somebody help me? Thanks

有帮助吗?

解决方案

Make sure you execute the script as python entrega2.py

Or

Add the following at the top of the script:

#!/usr/bin/env python 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top