python如何给软件设置到期失效
发布日期:2021-05-07 21:44:32 浏览次数:45 分类:技术文章

本文共 513 字,大约阅读时间需要 1 分钟。

#!/usr/bin/env python# -*- coding: utf-8 -*- import time def now():    return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))     s = '2018-10-26 00:00:00'print now()if now() > s:    print '已过期,无法正常使用'else:    print '未过期,可以正常使用'#s指的是你想要的失效时间。#now()指的是当前时间。

在这里插入图片描述

#!/usr/bin/env python# -*- coding: utf-8 -*-import timedef now():    return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))     s = '2018-10-06 00:00:00'print now()if now() > s:    print '已过期,无法正常使用'else:    print '未过期,可以正常使用'

在这里插入图片描述

上一篇:python生成唯一Id的几种方法
下一篇:python 导航栏

发表评论

最新留言

很好
[***.229.124.182]2025年04月09日 19时06分53秒