test_rotor.py
来自「mallet是自然语言处理、机器学习领域的一个开源项目。」· Python 代码 · 共 29 行
PY
29 行
import rotorr = rotor.newrotor("you'll never guess this")r = rotor.newrotor("you'll never guess this", 12)A = 'spam and eggs'B = 'cheese shop'a = r.encrypt(A)print `a`b = r.encryptmore(B)print `b`A1 = r.decrypt(a)print A1if A1 != A: print 'decrypt failed'B1 = r.decryptmore(b)print B1if B1 != B: print 'decryptmore failed'try: r.setkey()except TypeError: passr.setkey('you guessed it!')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?