Determine whether a file exists os.path.exists (file_path)
To delete a file: os.remove (file_path)
import os
file_path="d:/mk.txt"
if os.path.exists(file_path)==True:
os.remove(file_path)
Determine whether a file exists os.path.exists (file_path)
To delete a file: os.remove (file_path)
import os
file_path="d:/mk.txt"
if os.path.exists(file_path)==True:
os.remove(file_path)