How do I make a script that Clean or Remove a file?

Yes I have googled it and i have found two scripts that I have tried but I’m total noob so I dont know where to put my “Path” or “FileName” and where I should just leave it. Would be glad if someone could explain. (Never used python before) :eek:

def clear(file, filePath):
‘’‘clears file’’’
filePath = filePath + file
path = bge.logic.expandPath(filePath)
saves = open(path, ‘w’)
saves.write("")
saves.close()