python修改电脑时间启动xshell

≯℡__Kan透↙ 提交于 2019-12-02 14:31:37
# coding=utf-8 """@Time    : 2019/01/21  上午 10:27 @Author  : hzsyy@FileName: modifySystemTime.py@IDE     : PyCharm"""import osimport timeimport ntplibc = ntplib.NTPClient()response = c.request('pool.ntp.org')ts = response.tx_timenewDate = time.strftime('%Y-%m-%d', time.localtime(ts))_time = time.strftime('%X', time.localtime(ts))oldDate = "2018-12-20"os.system('date {} && time {}'.format(oldDate, _time))time.sleep(5)os.popen(r"D://xshell//Xshell.exe")time.sleep(4)os.system('date {} && time {}'.format(newDate, _time))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!