![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 50
率毛毛虫
这个作者很懒,什么都没留下…
展开
-
Python 数据类型--字典(dict)基本操作
python,dict ,字典 基本操作原创 2017-06-29 10:46:20 · 1639 阅读 · 0 评论 -
Centos vim python 开发环境配置
Centos python 自动补全插件:pydiction1 Pydiction主要包含三个文件:python_pydiction.vim -- Vim plugin that autocompletes Python code.complete-dict -- Dictionary file of Python keywords, modules, etc原创 2017-10-30 10:08:25 · 767 阅读 · 0 评论 -
Fixing ImportError: cannot import name ‘urlencode’ in Python3
Problem:Your python 3.x interpreter prints the error messageImportError: cannot import name 'urlencode' Solution:As described by Fred Foo here on StackOverflow, Python3 contains转载 2017-12-20 17:47:29 · 4755 阅读 · 0 评论 -
python使用ConfigParse解析配置文件
1 my.cnf 样板数据[client]port = 3306user = mysqlpassword = mysql[mysqld]basedir = /usrdatadir = /var/lib/mysqltmdir = /tmpskip-external-locking[mysql]host = 127.0.0.12 基本操作#! /u原创 2017-12-17 23:14:19 · 1158 阅读 · 0 评论 -
python 两个列表转换字典
#定义列表i=['a','b','c','d']l=[1,2,3]#转换字典dict(zip(i,l))原创 2018-01-11 17:38:43 · 5491 阅读 · 0 评论 -
从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存。
def write(): with open("test.txt",'r+') as f: str=raw_input("please input a string:\n") str=str.upper() f.write(str)if __name__ == '__main__': write()原创 2018-01-11 17:46:14 · 20599 阅读 · 0 评论 -
ansible 简单优化
vi /etc/ansible/ansible.cfg[defaults]sh_args = -o ControlMaster=auto -o ControlPersist=5dpipelining = Truegathering = smartfact_caching_timeout = 86400fact_caching = jsonfilefact_caching原创 2018-01-24 10:41:59 · 347 阅读 · 0 评论 -
使用python 分析统计nginx访问日志ip次数并且排序
1 数据样本221.7.8.21 - - [05/Dec/2017:00:04:53 +0800] "GET /qbwx/ml_files/ss33.jpg HTTP/1.1" "http://tt.xxx.cn/ocpc/haikang/ocpc/12?ETT02" "Mozilla/5.0 (Linux; Android 6.0.1; ATH-AL00 Build/HONORATH-A原创 2017-12-05 10:25:33 · 2518 阅读 · 0 评论 -
centos 6 将python 2.6 升级到python 2.7
1 python 安装1.1 安装其它的必需包yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel1.2 下载python-2.7.13安装包wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgztar -xf Python-原创 2017-07-21 17:19:45 · 205 阅读 · 0 评论 -
conda的安装及使用
1 系统:centos 6.8 64位下载:https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh2 安装sh Miniconda3-latest-Linux-x86_64.sh3 基本操作使用查看已经安装的包conda list安装软件包conda install原创 2018-01-10 10:25:08 · 2110 阅读 · 0 评论 -
python 使用sys.stdin和fileinput读入标准输入
1 使用sys.stdin 读取标准输入[root@c6-ansible-20 script]# cat demo02.py #! /usr/bin/env pythonfrom __future__ import print_functionimport sysfor line in sys.stdin: print(line,end="")原创 2017-10-30 22:32:18 · 2002 阅读 · 0 评论 -
python权限设置
https://hui.lu/yong-hu-shu-ju-ku-biao-jie-gou-hua-fen/转载 2017-09-26 15:13:49 · 1585 阅读 · 0 评论 -
tornado单线程服务器配置
import tornado.webimport tornado.httpserverimport tornado.optionsimport tornado.ioloopfrom tornado.options import define,optionsdefine("port",type=int,default=9000)#视图class I原创 2017-09-14 11:08:42 · 409 阅读 · 0 评论 -
python psutil 插件安装
python psutil 插件安装原创 2017-07-11 09:54:18 · 819 阅读 · 0 评论 -
centos 6 安装pip
centos python pip原创 2017-06-22 15:26:48 · 477 阅读 · 0 评论 -
python 统计当前修改html文件中的https
python 统计当前修改html文件中的https原创 2017-07-10 11:48:01 · 458 阅读 · 0 评论 -
python 3 django连接mysql数据库配置
python 3 django 连接数据库原创 2017-07-10 14:50:30 · 353 阅读 · 0 评论 -
【centos】 error: command 'gcc' failed with exit status 1
1 错误信息:centos error: command 'gcc' failed with exit status 13 原因及解决方法用安装Python模块出现error: command 'gcc' failed with exit status 1 ,明明装了gcc的,怎么会不行呢,然后发觉是failed不是not found,这说明这个错误个gcc没多大关系,原创 2017-08-22 16:29:58 · 846 阅读 · 0 评论 -
安装python 模块IPy
1 安装IPY模块 wget https://pypi.python.org/packages/source/I/IPy/IPy-0.81.tar.gz --no-check-certificate tar -xf IPy-0.81.tar.gz cd IPy-0.81 python setup.py install原创 2017-08-22 16:55:35 · 1664 阅读 · 0 评论 -
使用python 发邮件
案例1 :简单文本格式#!usr/bin/env python #-*- coding:utf-8 -*- """ @author:zyb @file: mail.py @time: 2017/08/23 """import smtplibimport stringHOST='smtp.139.com' #定义smtp主机SUBJ原创 2017-08-23 10:54:35 · 383 阅读 · 0 评论 -
windows 安装mysql-python
下载地址http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python安装pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl原创 2017-08-24 14:28:45 · 310 阅读 · 0 评论 -
tornado 多线程服务器配置
# coding:utf8import tornado.webimport tornado.ioloopimport tornado.optionsimport tornado.httpserverimport tornado.netutilimport tornado.processfrom tornado.options import options, de原创 2017-09-14 11:06:59 · 1811 阅读 · 0 评论 -
python 操作hadoop
参考网站:http://arrow.apache.org/docs/python/filesystems.html#hadoop-file-system-hdfs环境:python 2.7.14 +pyarrow + hadoop 2.7系统配置File System InterfacesIn this section, we discuss filesyste原创 2018-01-10 10:42:20 · 3650 阅读 · 0 评论