
Python技术积累
文章平均质量分 71
野小喵
我祈祷拥有一颗透明的心灵,和会流泪的眼睛。
展开
-
Python 初体验 POST HTTP 请求
由于项目调试需要用到POST请求,原创 2014-04-03 19:11:24 · 5051 阅读 · 0 评论 -
Python Dict 词典的用法
Dict Hash TablePython's efficient key/value hash table structure is called a "dict". The contents of a dict can be written as a series of key:value pairs within braces { }, e.g. dict = {key1:value翻译 2015-09-29 15:39:51 · 899 阅读 · 0 评论 -
python string 使用正则表达式 split()
By using (,), you are capturing the group, if you simply remove them you will not have this problem.>>> str1 = "a b c d">>> re.split(" +", str1)['a', 'b', 'c', 'd']However there翻译 2015-09-29 18:54:43 · 5373 阅读 · 0 评论 -
python 格式规范工具 autopep8 Tool to convert Python code to be PEP8 compliant
You can use autopep8! Whilst you make yourself a cup of coffee this tool happily removes all those pesky PEP8 violations which don't change the meaning of the code.1、Install it via pip:pip i翻译 2015-09-29 15:25:46 · 1999 阅读 · 0 评论 -
python 获取当前时间
原创文章请注明转载自老王python,本文地址:http://www.cnpythoner.com/post/89.html作者:老王@python python 教程老王python,提供pythn相关的django 教程和python 下载,希望大家能够喜欢!python 获取当前时间我有的时候写程序要用到当前时间,我就想用python去取当前的转载 2015-09-29 13:09:42 · 900 阅读 · 0 评论 -
python 使用全局变量 global
原出处:http://stackoverflow.com/questions/423379/using-global-variables-in-a-function-other-than-the-one-that-created-themglobvar = 0def set_globvar_to_one(): global globvar # Needed to mo翻译 2015-09-29 15:44:48 · 1962 阅读 · 0 评论 -
python2转3格式自动工具:2to3 , 以及python3相对于python2 修改的一些内容
来源官方文档:https://docs.python.org/2/library/2to3.html#to3-automated-python-2-to-3-code-translation2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to tran原创 2015-09-29 13:05:51 · 3132 阅读 · 0 评论 -
Python Join Examples
原文链接:点我OverviewThis post will show some examples of the Python join method. What is important to remember is that the character that joins the elementsis the one upon which the function is转载 2015-09-08 10:12:00 · 474 阅读 · 0 评论 -
Python 库之 os 源码
r"""OS routines for Mac, NT, or Posix depending on what system we're on.This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is one of the modules posixpat原创 2015-09-06 16:56:28 · 3036 阅读 · 0 评论 -
Google Python Class 之——正则表达式提取html网页数据字段
需要提取的内容格式:Popularity in 1990....1MichaelJessica2ChristopherAshley3MatthewBrittany#!/usr/bin/python# Copyright 2010 Google Inc.# Licensed under the Apache License, Version 2.0# htt原创 2015-09-06 16:14:09 · 2489 阅读 · 0 评论 -
Python File writelines() Method 按行写文件
DescriptionThe method writelines() writes a sequence of strings to the file. The sequence can be any iterable object producing strings, typically a list of strings. There is no return value.转载 2015-09-07 11:30:18 · 4520 阅读 · 0 评论 -
Python 库之SRE正则表达式 re 源码
## Secret Labs' Regular Expression Engine## re-compatible interface for the sre matching engine## Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.## This version of the SRE libr原创 2015-09-06 10:33:18 · 6493 阅读 · 0 评论 -
python 退出程序sys.exit 的退出码
查看python手册,得到下列信息sys.exit([arg])Exit from Python. This is implemented by raising the SystemExit exception, so cleanup actions specified by finally clauses of try statements are honored, and原创 2015-09-08 11:13:12 · 6784 阅读 · 0 评论 -
PEP 8 -- Style Guide for Python Code 编程规范
原文先占坑 原文链接PEP:8Title:Style Guide for Python CodeVersion:6c208fbae66cLast-Modified:2015-04-22 14:09:41 -0700 (Wed, 22 Apr 2015)Author:Guido van Rossum , Bar翻译 2015-09-08 11:01:02 · 2779 阅读 · 0 评论 -
Google Python Class 之——日志re分析,批量下载图片,形成html目录
#!/usr/bin/python# Copyright 2010 Google Inc.# Licensed under the Apache License, Version 2.0# http://www.apache.org/licenses/LICENSE-2.0# Google's Python Class# http://code.google.com/edu/langu翻译 2015-09-08 10:34:37 · 897 阅读 · 0 评论 -
Google Python Class 学习笔记(1) Introduce String list del
1、python 带参数的main函数: if len(sys.argv) >= 2: name = sys.argv[1] else: name = 'World'如 运行 pyhon hello.py Zhang,参数数组argv中,第一个参数是hello.py 之后才是真正带的参数,与C++相同,但是与java不同,java直接是第一个。原创 2015-09-02 14:30:33 · 773 阅读 · 0 评论