python generate requirements.txt code example
Example 1: command to make requirements.txt
pip freeze > requirements.txt
Example 2: pip freeze requirements.txt
$ env1/bin/pip freeze > requirements.txt
$ env2/bin/pip install -r requirements.txt
Example 3: how to generate requirements.txt django
For Unix families: pip3 freeze > requirements.txt
For Windos: pip freeze > requirements.txt
Example 4: python generate uid
import uuid
print ("The random id using uuid1() is : ",end="")
print (uuid.uuid1())
Example 5: python generate requirements.txt
pip install pipreqs
pipreqs path/to/project
Example 6: generate binay image python
import numpy as np
from numpy import random
im_thresh = random.randint(1,256, (64,64))
im_thresh[im_thresh<255] = 0
im_thresh[im_thresh==255] = 1