{"id":12085,"date":"2022-03-16T05:10:28","date_gmt":"2022-03-16T09:10:28","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=12085"},"modified":"2022-03-16T05:10:31","modified_gmt":"2022-03-16T09:10:31","slug":"how-to-write-a-file-in-python-2","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/how-to-write-a-file-in-python-2\/","title":{"rendered":"How to Write a File in Python"},"content":{"rendered":"\n
Write a file in Python code example.<\/p>\n\n\n\n
file = open("testfile.txt","w")\u00a0\n\nfile.write(\u201cHello World\u201d)\u00a0\n\u00a0\nfile.close()\u00a0<\/code><\/pre>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[953,27,15,16],"tags":[433,471,475,544,591,635,638],"yoast_head":"\nHow to Write a File in Python [Snippet]<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n