2019年6月30日

python同时执行两个函数

摘要: 使用两个线程同时执行两个函数, def fun1(): while True: time.sleep(2) print("fun1") def fun2(): while True: time.sleep(6) print("fun2") threads = [] threads.append(th 阅读全文

posted @ 2019-06-30 18:35 吃我一枪 阅读(11556) 评论(0) 推荐(1) 编辑

锐捷网络自动连接python脚本

摘要: 1 实现锐捷网络的连接,当断开后自动重连 import os import sys import time ip = 'www.baidu.com' print('开始ping百度') backinfo = os.system('ping -c 1 -w 1 %s'%ip) # 实现pingIP地址 阅读全文

posted @ 2019-06-30 18:23 吃我一枪 阅读(964) 评论(0) 推荐(0) 编辑

sudo无需输入密码设置

摘要: 注意这个是无需输入密码的设置,不是无需输入sudo 1 在终端输入: sudo gedit /etc/sudoers 2 在打开文件中的root ALL=(ALL:ALL) ALL下一行添加"自己用户名字 ALL=(ALL) ALL",例如用户名是Tom,则添加:Tom ALL=(ALL) ALL 阅读全文

posted @ 2019-06-30 14:29 吃我一枪 阅读(1855) 评论(0) 推荐(0) 编辑

导航