Skip to content

Export string as a file in Python

Advertisements
text_file = open("example.txt", "w")
n = text_file.write('Welcome to poopcode.com')
text_file.close()
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.