上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 60 下一页

2018年5月3日

Python进行URL解码

摘要: 所用模块:urllib 所用函数:urllib.unquote() 案例 输出 问题扩展 urllib.unquote()目的是对url编码进行解码,与该函数对应的是编码函数urllib.quote() 通常如果一样东西需要编码,说明这样东西并不适合传输。原因多种多样,如Size过大,包含隐私数据。 阅读全文

posted @ 2018-05-03 10:44 星河赵 阅读(4333) 评论(0) 推荐(0)

2018年5月2日

Python 执行linux 命令

摘要: 2.os.popen # 该方法不但执行命令还返回执行后的信息对象 popen(command [, mode='r' [, bufsize]]) -> pipeOpen a pipe to/from a command returning a file object. tmp = os.popen 阅读全文

posted @ 2018-05-02 14:25 星河赵 阅读(526) 评论(0) 推荐(0)

2018年5月1日

vim 配色(mac)

摘要: 1.进入当前用户目录,新建 .vimrc ,并加入如下内容: 2.开启行号 选择颜色 阅读全文

posted @ 2018-05-01 17:22 星河赵 阅读(212) 评论(0) 推荐(0)

Linux: grep多个关键字“与”和“或”

摘要: 1、或操作 2、与操作 3、其他操作 阅读全文

posted @ 2018-05-01 16:52 星河赵 阅读(40002) 评论(0) 推荐(3)

2018年4月27日

python unicode to str and str to unicode

摘要: @staticmethod def unicode2str(p_unicode): v = p_unicode.encode('unicode-escape').decode('string_escape') if p_unicode is not None else None return v @staticmethod def... 阅读全文

posted @ 2018-04-27 18:09 星河赵 阅读(219) 评论(0) 推荐(0)

2018年4月20日

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 1: ordinal not in range(128)

摘要: 使用codecs模块 codecs模块能在处理字节流的时候提供很大帮助。你可以用定义的编码来打开文件并且你从文件里读取的内容会被自动转化为Unicode对象。 试试这个: 阅读全文

posted @ 2018-04-20 19:42 星河赵 阅读(390) 评论(0) 推荐(0)

2018年4月19日

查看本机密钥 以及服务器授权密钥 免密码登录

摘要: 服务器授权密钥: vim ~/.ssh/authorized_keys 查看本机密钥 cat ~/.ssh/id_rsa.pub 阅读全文

posted @ 2018-04-19 17:35 星河赵 阅读(2208) 评论(0) 推荐(0)

Mac在Finder中显示/usr、/tmp、/var等隐藏目录

摘要: Finder中默认是不显示/usr、/tmp、/var等隐藏目录的,通过在终端中输入一下命令来另其显示: 之后还需重启Finder,最简单的方法是Alt+鼠标右击屏幕下方的Finder图标,选择“重新开启”即可。 阅读全文

posted @ 2018-04-19 16:18 星河赵 阅读(435) 评论(0) 推荐(0)

2018年4月18日

MAC下是用brew安装Redis

摘要: 安装brew 在命令行里运行下面的命令,需要等待一段时间。 安装Redis 安装完成后可以是用下面的命令来查看是否安装成功 安装完成后就可以来安装redis了 运行 其他 运行后自动在后台运行,关闭后也会继续运行。可以使用端口检测命令来查看。 阅读全文

posted @ 2018-04-18 20:52 星河赵 阅读(436) 评论(0) 推荐(0)

python用zipfile模块打包文件或是目录、解压zip文件实例

摘要: #!/usr/bin/env python # -*- coding: utf-8 -*- from zipfile import * import zipfile #解压zip文件 def unzip(): source_zip="c:\\update\\SW_Servers_20120815.zip" target_dir="c:\\update\\" ... 阅读全文

posted @ 2018-04-18 12:37 星河赵 阅读(3073) 评论(0) 推荐(0)

上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 60 下一页

导航