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?

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
Stew
  • 4,495
  • 6
  • 31
  • 41

1 Answers1

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
Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160