Python 3.3无法导入Cryp

2024-04-18 17:20:21 发布

您现在位置:Python中文网/ 问答频道 /正文

当我在命令行上输入import Crypt时,它会说:

>>>import crypt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python33\lib\crypt.py", line 3, in <module>
    import _crypt
ImportError: No module named '_crypt'

Tags: 命令行inimportmoststdinlinecallfile
2条回答

如果您要寻找的只是crypt(3)的实现,那么我已经构建了一个纯Python实现here,从this public domain C implementation移植过来。它非常慢(比我的机器上Python内置的crypt慢2800倍,已经是OpenSSL的DES_crypt速度的一半),但是如果你只是计算偶尔的散列,那应该不是问题。

你是不是在写图像板?

^{} module是用于加密Unix密码的Unix^{} library的接口。它被记录为在Windows上不可用。它不是一个通用密码库。

相关问题 更多 >