import os
os.remove("filename.txt")
import os
if os.path.isfile('/Users/test/new_file.txt'):
os.remove('/Users/test/new_file.txt')
print("success")
else:
print("File doesn't exists!")
import os
ch = os.chdir("Directory") #for example: E:/../../
files = os.listdir()
for file in files:
if "file name .format" in file:
os.remove(file)
#code by fawlid