How delete all data from the '.txt' file using python 2? -
i want delete data data.txt file:
how can that?
with open('data.txt', 'w'): pass this delete contents of 'data.txt', leaving empty file. (this works in python3 too).
i want delete data data.txt file:
how can that?
with open('data.txt', 'w'): pass this delete contents of 'data.txt', leaving empty file. (this works in python3 too).
Comments
Post a Comment