#48 Python for Beginners: Redirect Output of Print Function to a File

preview_player
Показать описание
This video talks about how to create a text file from the output of print function in Python.

#pythontutorial #pythonforbeginners #Python
Рекомендации по теме
Комментарии
Автор

You saved me. Thanks!
A little tip. If you type "xt" instead of "wt" then it will automatically create the text file. Incase you dont feel like making a new random text file with the same name.

Though uncertain how effective it is.
But usually if you type

If True: with the wt code

and after with if not True: with the xt code. Then that worked for me.

Sparrows
Автор

Ma'am I've created a textbox on my gui n want to print the realtime output in that textbox it would be helpful hearing from you

boby
Автор

But how to direct your python code output to a txt file don't want to simply add a line or append a line

rishabhshah
Автор

when i do this : with open("valid_proxy.txt", "w+") as f:
print(proxies, file=f)
he writing the data like that and not each by column ['51.250.13.88:80', '12.186.205.122:80'...]

mariustm