import os def fileAppend(filename): myfile = open(filename,'a') myfile.write("####&&&&") myfile.close if __name__ == '__main__': filename = 'test.rmvb' fileAppend(filename) print(filename + ' is Changed.')