![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
MasterHaKu
技术全面的狼王
展开
-
利用PyMysql访问windows下的MySql数据库
1. 下载PyMysql并且安装 下载地址 下载zip包后解压到目录,进入该目录,执行以下命令安装 python setup.py install 2. 编写一个简单的数据库访问程序 simple_mysql.py import pymysql conn = pymysql.connect(host='127.0.0.1', user='root原创 2016-04-03 11:28:57 · 417 阅读 · 0 评论 -
Python小任务 - 如何编写指定时间执行的Python小程序
我们在平时的工作中经常会遇到这样的需求,需要再某个时间点执行一段程序逻辑。 那么,在python中我们是怎么做的呢? 下面看代码: waitDesignatedTimeToRun.py import time, datetime startTime = datetime.datetime(2016, 6, 8, 16, 45, 0) print('Program not原创 2016-06-08 16:51:53 · 5072 阅读 · 2 评论 -
python网络爬虫 - 如何伪装逃过反爬虫程序
有的时候,我们本来写得好好的爬虫代码,之前还运行得Ok, 一下子突然报错了。 报错信息如下: Http 800 Internal internet error 这是因为你的对象网站设置了反爬虫程序,如果用现有的爬虫代码,会被拒绝。 之前正常的爬虫代码如下: from urllib.request import urlopen ... html = urlop原创 2016-06-09 17:35:35 · 433 阅读 · 0 评论