openopenfp = open(r'd:\mr.txt','a+')print("要么出众,要么出局",file=fp)fp.closed()import datetimeprint('当前年份:'+str(datetime.datetime.now().year))print('当前时间:'+datetime.datetime.now().strftime('%y-%m-%d %H:%M:%S'))