Tony Tan tonytan748.github.io
1.

PIP Guide

PIP Guide ###目录 前言 获取pip2.1. 脚本安装pip2.2. 使用包管理软件安装2.3. 更新pip pip基本使用3.1. 安装PyPI软件3.2. 查看具体安装文件3.3. 查看哪些软件需要更新3.4. 升级软件包3.5. 卸载软件包 pip简明手册4.1. 安装具体版本软件4.2. Requirements文件安装依赖软件4...
2.

Fill Character in String In Python

In this part we will talk about Python String module. import string print string.center("abc",5,"-") # -abc- print string.ljust("abc",5,"-") #abc-- print string.rjust("ab...
3.

Python 字符串/元组/列表/字典/互转

Python format character tuple list and dist each other #-*-coding:utf-8-*- #1、字典 dict = {'name': 'Zara', 'age': 7, 'class': 'First'} #字典转为字符串,返回: {'age': 7, 'name': 'Zara', ...
4.

Download Files by Three Ways

Use urllib urllib2 requests download files from url Way 1: import urllib print "downloading with urllib" url = 'http://www.pythontab.com/test/demo.zip' print "downl...
5.

Windows如何使用Python操作摄像头

Windows如何使用Python操作摄像头 用过USB摄像头的都知道,你需要使用鼠标来操作它,比如截个图,录个像什么的,要点N次鼠标,对于我们那些不喜欢多次点击鼠标的人来说,这是一件很boring的事情,所以,本文将教你如何使用Python来操作摄像头。 这里,我们需要三个Python库: VideoCapture, PIL 和 pygame...
6.

Top 10 Algorithm

快速排序算法,堆排序算法,归并排序,二分查找算法,DFS,BFS,Dijkstra算法,动态规划算法,朴素贝叶斯分类算法 ###算法一:快速排序算法 快速排序是由东尼·霍尔所发展的一种排序算法。在平均状况下,排序 n 个项目要Ο(n log n)次比较。在最坏状况下则需要Ο(n2)次比较,但这种状况并不常见。事实上,快速排序通常明显比其他Ο(n lo...
7.

How to use Python datetime and time

How to use Python datetime and time Time method often used1.Get now time: Use time method, get the now Timestamp In [42]: time.time() Out[42]: 1408066927.208922 Change timesta...
8.

pygeoipmap.py

pygeoipmap.py #!/usr/bin/env python # coding: utf-8 from __future__ import print_function, unicode_literals, with_statement import argparse import requests import json import ...
9.

Export Excel in Django1.7

How to export Excel from Database in Django 1.7 Install xlwt pip install xlwt Create Database Item Export Excel in Views def export_item_list(request): wb=xlwt.Workbook...
10.

Python字符串替换的2种方法

Two ways replace character in Python python 字符串替换 是python 操作字符串的时候经常会碰到的问题,这里简单介绍下字符串替换方法。python 字符串替换可以用2种方法实现:1是用字符串本身的方法。2用正则来替换字符串 下面用个例子来实验下:a = ‘hello word’把a字符串里的word替换为p...