: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/www/wwwroot/www.iicats.com/wp-includes/class-wp-image-editor-imagick.php</b> on line <b>156</b><br />
https://resources.olei.me/iicats/2018/03/2018-03-20_101929_9.jpg)
python 实现生成验证码的逻辑
假设我们有一个 fonts 的文件夹,里面有 1.ttf,2.ttf,3.ttf 三个字体文件具体代码实现代码 codes.py:# coding:utf8from PIL import ImageDraw, ImageColor, ImageFile, ImageFont, ImageFilter, Imageimport randomimport os...
: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/www/wwwroot/www.iicats.com/wp-includes/class-wp-image-editor-imagick.php</b> on line <b>156</b><br />
https://resources.olei.me/iicats/2018/12/20181218_104925_43.jpg)
@classmethod 与 @staticmethod 以及属性函数 @property
之前是一知半解,现在懂了,记录一下 @classmethod 举例 class Date(object): def __init__(self,day=0,month=0,year=0) self.day = day self.month = month self.year = year @classmethod ...
: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/www/wwwroot/www.iicats.com/wp-includes/class-wp-image-editor-imagick.php</b> on line <b>156</b><br />
https://resources.olei.me/iicats/2018/09/20180925_031131_59.jpeg)
符合语言习惯的 Python 编程技巧
Python 最大的优点之一就是语法简洁,好的代码就像伪代码一样,干净、整洁、一目了然。要写出 Pythonic(优雅的、地道的、整洁的) 代码,需要多看多学大牛们写的代码,github 上有很多非常优秀的源代码值得阅读,比如:reque...
: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/www/wwwroot/www.iicats.com/wp-includes/class-wp-image-editor-imagick.php</b> on line <b>156</b><br />
https://resources.olei.me/iicats/2018/05/2018-05-17_062700_27.jpg)
Python 的 flask:models.py 来创建 mysql 数据库
Python 3.6 用到的包 flask 下有一个叫 flask_sqlalchemy 的数据库框架,没有安装的可以使用下面的来安装 $ pip install -i https://pypi.douban.com/simple/ flask-sqlalchemyflask 就不多说了 $ pip install -i https://pypi.doub...
: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/www/wwwroot/www.iicats.com/wp-includes/class-wp-image-editor-imagick.php</b> on line <b>156</b><br />
https://resources.olei.me/iicats/2018/05/2018-05-14_074401_78.jpg)
Python 使用 virtualenvwrapper 创建虚拟环境
为了不影响本地的大环境或者同时安装 python2 以及 python3 之后的方便切换,使用 python 的虚拟环境大多数用 virtualenv 来做,我用 virtualenvwrapper 来做,方便管理 Windows 环境下假设 python3 在 path 下,python2 未添加安装 pip inst...

flask 的 Blueprint,前后台蓝图注册
文件结构创建一个 shizhan 文件夹,根据 flask 的文件结构,在 shizhan 里面创建 app 文件夹,其他如下的结构├── app│ ├── __init__.py│ ├── admin│ │ ├── __init__.py│ │ └── views.py│ ├── home│ │ ├── __init_...

python 利用 smtp 来发送邮件 (带附件)
运行环境:python2.7,python3.x 的话,把代码中的中文的字符前的 u 去掉就好,这是 2 与 3 基本的区别 # -*- coding: utf-8 -*-import smtplibimport email.MIMEMultipart # import MIMEMultipartimport email.MIMEText # import...