【问题标题】:Can I use the secrets module with a version of Python earlier than 3.6?我可以在 Python 3.6 之前的版本中使用 secrets 模块吗?
【发布时间】:2018-04-09 20:27:17
【问题描述】:

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

如果没有,是否有具有类似功能的第 3 方模块?

【问题讨论】:

  • 通常在 pypi 上有一个 backport 可用,但这次似乎没有。

标签: python python-3.x cryptography python-3.6 backport


【解决方案1】:

现在存在用于 Python 版本 2.7、3.4 和 3.5 的 secrets 模块的反向移植:python2-secrets(名称有些混淆)。

安装:

pip install python2-secrets

【讨论】:

    猜你喜欢
    • 2023-03-03
    • 1970-01-01
    • 2016-04-30
    • 2019-07-15
    • 1970-01-01
    • 1970-01-01
    • 2019-02-07
    • 1970-01-01
    • 2019-04-13
    相关资源
    最近更新 更多