how to delete all content form a file using python code example
Example: python delete all data from file
file = open("sample.txt","r+")
file.truncate(0)
file.close()
file = open("sample.txt","r+")
file.truncate(0)
file.close()