python个人笔记
牙疼疼疼疼疼
生命不息,编程不止
展开
-
PY数据库的连接
Mysql:import MySQLdbdb = 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 · 454 阅读 · 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 · 146 阅读 · 0 评论 -
Python小技巧
1.2个变量交换值a, b = 5, 8a, b = b, aprint(a)print(b)2.列表转字符串list = ["one", "two"]print(",".join(list))3.获取列表中频率最高的值from collections import Counterlist = ["one", "one", "two"]prin...原创 2019-05-07 13:39:54 · 105 阅读 · 0 评论