file-writing

How to redirect 'print' output to a file?

How to redirect 'print' output to a file? Question: I want to redirect the print to a .txt file using Python. I have a for loop, which will print the output for each of my .bam file while I want to redirect all output to one file. So I tried to put: f = open(‘output.txt’,’w’) …

Total answers: 15