首页 软件开发 代码片段 python ( Page 89 )

python 1073

#Python
演示类和继承

class Employee: pass lee = Employee() lee.name = 'leefang' lee.age = 28

2014-10-27 775

#Python
搜索路径

# encoding: utf-8 import os class SearchPath(object): @classmethod def get(cls, search_pat…

2014-10-26 427

#Python
模拟post或get请求,从服务器取得数据

def __init__(self): wx.Frame.__init__(self,None,-1,"Example For TextCtrl",size=(600,500)) …

2014-10-26 619

#Python
演示异常

#coding=utf-8 #异常用法 import sys #---------------- #sys.exc_info()[2].tb_lineno值不是固定的 try: x…

2014-10-26 770

#Python
打印对象的属性

#coding=utf-8 class AttrDisplay: def getAttrs(self): res = [] for key in self.__dict__: re…

2014-10-24 886

#Python
批量提取word格式的调查表信息

#coding:utf-8 import os import win32com from win32com.client import Dispatch, constants fr…

2014-10-23 624

#Python
python版实现文本左右对齐排版

# python版实现文本左右对齐排版 # 题目来源: http://www.bathome.net/thread-1246-1-1.html # 依山居 7:17 2015/11…

2014-10-22 496

#Python
整数中1出现的次数(从1到n整数中1出现的次数)

# -*- coding:utf-8 -*- class Solution: def NumberOf1Between1AndN_Solution(self, n): count …

2014-10-22 798

#Python
python 爬虫 下载妹子图片

#coding:utf-8 import requests from bs4 import BeautifulSoup import re DownPath = "/jiaoben…

2014-10-22 698

#Python
系统监控

#! /usr/bin/env python #coding=utf-8 import sys,os ###得到系统当前路径 ##1 :根据文件名 得到当前路径名 print os…

2014-10-21 814

#Python
爬取和保存豆瓣小组图片

#!/usr/bin/env python3 #-*- coding=utf-8 -*- import requests import time import random imp…

2014-10-21 615

#Python
自己编的汉诺塔游戏过程

def tower(a,b,c,n): if n==1: print "put 1 from b to a." elif n==2: print "put 1 from %r to…

2014-10-21 308