
python个人笔记
牙疼疼疼疼疼
生命不息,编程不止
展开
-
PY数据库的连接
Mysql: import MySQLdb db = MySQLdb.connect("host", "userName", "password", database="erp_core", charset='utf8') cursor = db.cursor() sql = "select * from selection" cursor.execute(sql) num = cursor....原创 2019-04-11 14:21:48 · 518 阅读 · 0 评论 -
Selenium使用
1.基础依赖配置 pip install seleniun 安装ChromeDriver:https://chromedriver.storage.googleapis.com/index.html 下载完成后,Window 下,建议直接将 Chromedriver.exe 文件拖到 Python Scripts 目录下 2.鼠标事件操作 context_click() # 右击 d...原创 2019-05-08 14:31:16 · 182 阅读 · 0 评论 -
Python小技巧
1.2个变量交换值 a, b = 5, 8 a, b = b, a print(a) print(b) 2.列表转字符串 list = ["one", "two"] print(",".join(list)) 3.获取列表中频率最高的值 from collections import Counter list = ["one", "one", "two"] prin...原创 2019-05-07 13:39:54 · 150 阅读 · 0 评论