Home  »  CodeProgrammingSnippetsTechnology   »   How to Write a File in Python

How to Write a File in Python

Posted: March 16, 2022 | by Site Host

Write a file in Python code example.

file = open("testfile.txt","w") 

file.write(“Hello World”) 
 
file.close() 

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

Share it!

See also  Make CSS Background Image Fit Screen