Can I use the secrets module with a version of Python earlier than 3.6?
Asked Answered
W

1

6

Python's secrets module was introduced in version 3.6. I'm working on an application using Python 3.4. Is there a way I can import the secrets module in a 3.4 environment (a la from __future__ import print)?

If not, is there a 3rd party module with comparable functionality?

Weeden answered 9/4, 2018 at 20:27 Comment(1)
Usually there's a backport available on pypi, but not this time it seems.Worm
M
1

A backport of the secrets module for Python versions 2.7, 3.4 and 3.5 now exists: the (somewhat confusingly named) python2-secrets.

Installation:

pip install python2-secrets
Marlonmarlow answered 4/3, 2019 at 12:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.