open

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