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

python 1073

#Python
汉诺塔实现

# -*- coding: utf-8 -*- def move(n, A, B, C): if n <= 0: return if n == 1: print('move'…

2015-07-23 349

#Python
python实现将excel数据添加到mongodb

在做文本处理时,有一些数据存储到了excel中,为了将数据导入mongodb,引入了pymongo,xlrd包 利用pymongo包进行数据库的连接 使用xlrd包读取excel数…

2015-07-23 835

#Python
每日迅雷会员爬虫

#coding=utf8 import urllib2 import codecs import re import time from lxml import etree url…

2015-07-22 1,007

#Python
地月关系统模拟图示

#!/usr/bin/env python3 """ turtle-example-suite: tdemo_planets_and_moon.py Gravitational s…

2015-07-21 272

#Python
演示可变参数函数

#演示可变参数函数 #!/usr/bin/python def f1(a,b): print a,b def f2(a,*b): print a,b def f3(a,**b): …

2015-07-21 887

#Python
python删除特定文件

#!/usr/bin/python # -*- coding: utf-8 -*- import os def del_files(path): for root , dirs, …

2015-07-20 410

#Python
# 根据比例求角度

from math import * degrees(asin(0.5))

2015-07-18 808

#Python
pygame wormy 贪吃蛇

import pygame,sys,random from pygame.locals import* FPS = 10 winx = 640 winy = 480 cellsiz…

2015-07-16 308

#Python
python黑客写阶乘

import sys @tailcall def fact(x, acc=1): if x: return fact(x.__sub__(1), acc.__mul__(x)) r…

2015-07-16 299

#Python
python实现汉诺塔

def printMove(fr,to): print 'move from ' + str(fr) + ' to ' + str(to) def Towers(n,fr,to,s…

2015-07-15 573
1 31 32 33 34 35 90