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

python 1073

#Python
python通过PyGame绘制图像并保存为图片文件

''' pg_draw_circle_save101.py draw a blue solid circle on a white background save the draw…

2015-05-24 249

#Python
python提交post数据到远程url

import sys, urllib2, urllib zipcode = "S2S 1R8" url = 'http://www.wunderground.c…

2015-05-24 758

#Python
python通过Tkinter显示网络图片

''' tk_image_view_url_io.py display an image from a URL using Tkinter, PIL and data_stream…

2015-05-24 835

#Python
python从ftp服务器下载文件

import ftplib ftp = ftblib.FTP("ftp.yourServer.com") ftp.login("username&qu…

2015-05-24 480

#Python
python编写的最简单的web服务器

下面的python代码用于监控本机的8080端口,当用于通过http请求,服务器返回固定的html代码 import SocketServer class MyRequestHan…

2015-05-24 177

#Python
linux下通过python获得指定网卡的ip地址

import socket import fcntl import struct def get_ip_address(ifname): """ &g…

2015-05-24 749

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

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

2015-05-24 786

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

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

2015-05-24 422

#Python
Python3.4 PIL的使用

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

2015-05-22 859

#Python
python分解质因数

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

2015-05-21 1,000

#Python
python基础教程代码分享

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

2015-05-20 420

#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