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

python 1073

#Python
python将文本转换成图片输出

#-*- coding:utf-8 -*- from PIL import Image,ImageFont,ImageDraw text = u'欢迎访问open-open.com…

2015-05-24 785

#Python
python从网络下载文件并获得文件大小、文件类型

import urllib2 from settings import COOKIES opener = urllib2.build_opener() cookies = &quo…

2015-05-24 422

#Python
用while编代码计算1+2+……+100

a=1 b=2 n=1 while n<100: a=a+b b=b+1 n=n+1 print a

2015-05-24 669

#Python
网站搬运工

# -*- encoding=utf8 -*- import urllib2 import lxml.html,re import os.path,stat,io,sys,glob…

2015-05-24 796

#Python
python登录pop3邮件服务器接收邮件

import poplib, string PopServerName = "mail.yourserver.com" PopServer = poplib.P…

2015-05-24 817

#Python
python获取当天日期

import datetime # Get a date object today = datetime.date.today() # General functions prin…

2015-05-24 787

#Python
python arp欺骗伪造网关代码

#coding:utf-8 ''' arp欺骗局域网pc,将伪造的网关mac以网关的arp应答发送给pc ''' from scapy.all import ARP,send,ar…

2015-05-24 784

#Python
python编程从一个ftp传输文件到另一个ftp服务器

import ftplib, sys ftp1 = ftplib.FTP("127.0.0.1", "book", "bookpw…

2015-05-24 786

#Python
Python3.4 PIL的使用

from PIL import Image, ImageFilter, ImageDraw, ImageFont, ImageEnhance, ImageFilter image1…

2015-05-22 858

#Python
python分解质因数

from math import * #判断n是否为素数 def isprime(n): if n <= 1: return 0 m = int(sqrt(n))+1 for…

2015-05-21 999

#Python
python基础教程代码分享

people = { 'Alice' : { 'phone' : '2341', 'addr' : 'Foo drive 23' }, 'Beth' : { 'phone' : '…

2015-05-20 419

#Python
去掉当前目录下电影名字前的框框

#!/usr/bin/env python # -*- coding:utf-8 -*- import os,re def main(): fileList=os.listdir(…

2015-05-19 474
1 49 50 51 52 53 90