09 2019 档案

摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import subprocess import datetime plist = [] p = subprocess.Popen('net user test1234 /domain',shell=True,stdout=subprocess.PIPE) out,err = p.communicate() 阅读全文
posted @ 2019-09-27 15:27 tec2019 阅读(1047) 评论(0) 推荐(0)
摘要:import pymysql cnn =pymysql.connect(host="localhost", user="root",password="1234567",database="test",charset="utf8") cursor=cnn.cursor() res =cursor.execute("select * from contacts;") print("{} rows i 阅读全文
posted @ 2019-09-27 11:04 tec2019 阅读(195) 评论(0) 推荐(0)
摘要:from datetime import timedelta, datetime yesterday = datetime.today()+timedelta(-1) yesterday_format = yesterday.strftime('%Y-%m-%d') print('昨天是:%s' %yesterday_format) 阅读全文
posted @ 2019-09-12 16:07 tec2019 阅读(2817) 评论(0) 推荐(0)
摘要:# encoding:utf-8 import logging import time class Logs: def __init__(self): self.logger = logging.getLogger() def writeLog(self): err = True self.logger.setLevel... 阅读全文
posted @ 2019-09-12 15:27 tec2019 阅读(125) 评论(0) 推荐(0)
摘要:配置文件截图如下: 提取主机和URL信息代码: 执行结果: 阅读全文
posted @ 2019-09-11 14:15 tec2019 阅读(1649) 评论(0) 推荐(0)
摘要:默认用foxfire浏览器,如果用chrome请到官网下载 chromedriver驱动,解压后放到python目录scripts下 然后添加环境变量,在Path下添加chromedrvier的路径。 阅读全文
posted @ 2019-09-04 15:27 tec2019 阅读(349) 评论(0) 推荐(0)