我可以将secrets模块与3.6之前的Python版本一起使用吗?

Ste*_*tew 5 python backport cryptography python-3.x python-3.6

Python的secrets模块是在3.6版中引入的。我正在使用Python 3.4开发应用程序。有什么办法可以在3.4环境(la from __future__ import print)中导入secrets模块?

如果不是,是否存在具有类似功能的第三方模块?

Zer*_*eus 1

secretsPython 版本 2.7、3.4 和 3.5 的模块向后移植现已存在:(命名有些令人困惑) python2-secrets

安装:

pip install python2-secrets
Run Code Online (Sandbox Code Playgroud)