上一页 1 2 3 4 5 6 7 8 9 ··· 34 下一页

2018年11月16日

python pytz时区设置模块

摘要: 如果你的程序要考虑时区,可以使用pytz。pytz官方文档:http://pytz.sourceforge.net/我使用的python版本:3.7.1 datetime模块中有tzinfo相关的东西,但是它是一个抽象类,文档上说:tzinfo is an abstract base clase, 阅读全文

posted @ 2018-11-16 11:24 zqifa 阅读(3705) 评论(0) 推荐(1) 编辑

python3 TypeError: Unicode-objects must be encoded before hashing

摘要: python3下,利用hash值对字符串进行md5加密时报错:TypeError: Unicode-objects must be encoded before hashing 原因是:python3跟python2区别:python3下字符串为Unicode类型,而hash传递时需要的是utf-8 阅读全文

posted @ 2018-11-16 10:27 zqifa 阅读(8558) 评论(0) 推荐(2) 编辑

2018年11月14日

centos7编译安装php7.2

摘要: 去官网下载php7.2安装包,选择一个结点下载:http://php.net/downloads.php 下载:wget -ivh http://cn.php.net/distributions/php-7.2.12.tar.gz解压源码包:tar -zxf php-7.2.12.tar.gz 安装 阅读全文

posted @ 2018-11-14 19:15 zqifa 阅读(392) 评论(0) 推荐(0) 编辑

2018年11月12日

python实现切换代理ip

摘要: 大量的处理爬虫的时候,IP地址容易被封掉,这个时候可以使用代理IP来帮助完成接下来的任务了 使用Requests模块来完成请求,代码如下: import urllib.requestimport requests url = "http://pv.sohu.com/cityjson?ie=utf-8 阅读全文

posted @ 2018-11-12 10:27 zqifa 阅读(2598) 评论(0) 推荐(0) 编辑

2018年11月8日

python列表(list)遍历

摘要: list = ['html', 'js', 'css', 'python'] 遍历列表方法1:for i in list: print("序号:%s 值:%s" % (list.index(i) + 1, i)) 遍历列表方法2:for i in range(len(list)): print("序 阅读全文

posted @ 2018-11-08 14:03 zqifa 阅读(3060) 评论(0) 推荐(0) 编辑

python去除\ufeff、\xa0、\u3000

摘要: 今天使用python处理一个txt文件的时候,遇到几个特殊字符:\ufeff、\xa0、\u3000,记录一下处理方法 代码:with open(file_path, mode='r') as f: s = f.read() 1.\ufeff 字节顺序标记 去掉\ufeff,只需改一下编码就行,把U 阅读全文

posted @ 2018-11-08 12:01 zqifa 阅读(20342) 评论(0) 推荐(3) 编辑

2018年11月5日

ubuntu防火墙ufw使用教程

摘要: 查看ubuntu版本cat /etc/issue或者lsb_release -a 防火墙 由于Linux原始的防火墙工具iptables过于繁琐,所以ubuntu默认提供了一个基于iptable之上的防火墙工具ufw。ubuntu 系统默认已安装ufw。ubuntu 9.10默认的便是UFW防火墙, 阅读全文

posted @ 2018-11-05 16:28 zqifa 阅读(24075) 评论(0) 推荐(3) 编辑

ubuntu忘记登录密码解决方法

摘要: 1.重启系统,长按Shift键,直到出现下面菜单。选择recovery mode(恢复模式)。2.接下来会进入如下界面,选择Drop to root shell prompt ,也就是获取root权限。3.在下面的# 后面敲入 cat /etc/shadow 查看用户名(如果连用户名都忘记的话)4. 阅读全文

posted @ 2018-11-05 16:26 zqifa 阅读(951) 评论(0) 推荐(0) 编辑

2018年10月29日

irc使用教程

摘要: 下面介绍几个IRC名词:NICKNAME (或nick) 昵称。在命令中可以表示你本人或者其他聊天客。#CHANNEL (或#chan) 频道、聊天室房间名字。房间名字前面一定要加 # 符号。服务器机器人 是irc上的服务器机器人。他的最基本职责是呆在房间内并使房间继续生效。在cr1.3以后的irc 阅读全文

posted @ 2018-10-29 18:36 zqifa 阅读(13509) 评论(1) 推荐(2) 编辑

2018年10月24日

pip查看已安装包列表

摘要: 输入命令: pip freeze 结果: certifi==2018.10.15chardet==3.0.4Django==2.1.2idna==2.7pytz==2018.5requests==2.20.0urllib3==1.24uWSGI==2.0.17.1 阅读全文

posted @ 2018-10-24 14:15 zqifa 阅读(2839) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 34 下一页

导航