pip freeze > requirements.txt
Showing posts with label output. Show all posts
Showing posts with label output. Show all posts
10 May 2024
How to output or create the requirements.txt file which is a list of all the needed software?
https://stackoverflow.com/questions/29715249/is-there-any-way-to-output-requirements-txt-automatically
24 March 2021
How to redirect 'print' output to a file using python?
How to redirect 'print' output to a file using python?
import sys
orig_stdout = sys.stdout
f = open('out.txt', 'w')
sys.stdout = f
for i in range(2):
print 'i = ', i
sys.stdout = orig_stdout
f.close()
Subscribe to:
Posts (Atom)