用Python写一个可以记日记的小程序

xiaoxiao2021-02-28  103

功能: 1.可记日记,可追加日记 2.可看到距离2018年还有多少天 写完以后直接存入默认文件夹

IDE:Pycharm 系统:macOS Python版本:3.5.2

以下为程序原文:

""" Created by LiXuefei in 2017.08.06 """ import time import sys date = time.strftime('%Y-%m-%d', time.localtime(time.time())) next_year = 1514736000 seconds = next_year - time.time() days = seconds//(60*60*24) print("Today is: ",date ,",there`s",int(days),"days left in 2018") def wirteNote(): print("Please input your dairy,if you want to stop,please input the order:'end'.") fd = open(date,'a') while True: line = input() if line == 'end': break fd.write(line+'\n') fd.close() wirteNote()

展望

一个可用的UI密码功能
转载请注明原文地址: https://www.6miu.com/read-51161.html

最新回复(0)