{"id":11846,"date":"2022-02-06T16:45:24","date_gmt":"2022-02-06T21:45:24","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=11846"},"modified":"2022-02-06T16:45:26","modified_gmt":"2022-02-06T21:45:26","slug":"python-delete-all-text-in-file","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/python-delete-all-text-in-file\/","title":{"rendered":"Python Delete all Text in Text File"},"content":{"rendered":"\n
f = open("filename.txt", "r+")\nf.truncate(0)\nf.close()<\/code><\/pre>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[953,15],"tags":[954,471,475],"yoast_head":"\nPython Delete all Text in Text File<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n