Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

python ·ÖÐÎ


´úÂëÈçÏ£º
#!/usr/bin/env python
# -*-coding:UTF-8-*-#
from common import *
import Image, ImageFilter, math, sys, os, random
def modifyImageObj(img, matrix) :
    width, height = img.size   
   
    for h in range(0, height) :       
        for w in range(0, width) :
            pixel = matrix[h][w]
            img.putpixel((w, h), pixel)
    return img
def initMatrix(h, w, v = (0, 0, 0)) :
    result = []
    for _h in range(0, h) :
        row = []
        for _w in range(0, w) :
            row.append(v)
        result.append(row)
    return result
size = (600, 600)
img = Image.new('RGB', size)
h, w = size
matrix = initMatrix(h, w, (0, 0, 0))
m = []
m.append([-0.04, 0, -0.19, -0.47, -0.12, 0.3, 0.25])
m.append([0.65, 0, 0, 0.56, 0.06, 1.56, 0.25])
m.append([0.41, 0.46, -0.39, 0.61, 0.46, 0.4, 0.25])
m.append([0.52, -0.35, 0.25, 0.74, -0.48, 0.38, 0.25])
n = 0
x, y, a, b, c, d, e, f, newx, newy = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
while n < 300000 :
    r = random.uniform(0, 1)
    if r <= m[0][6] :
        a=m[0][0]
        b=m[0][1]
        c=m[0][2]
        d=m[0][3]
        e=m[0][4]
        f=m[0][5]
    elif r <= m[0][6] + m[1][6] :
        a=m[1][0]
   &nb


Ïà¹ØÎĵµ£º

PythonÍêÈ«ÐÂÊֽ̳Ì

×÷Õߣºtaowen, billrice
http://www.cnblogs.com/taowen/articles/11239.html
Lesson 1 ×¼±¸ºÃѧϰPythonµÄ»·¾³
ÏÂÔصĵØÖ·ÊÇ£º
www.python.org
ΪÁË´ó¼ÒµÄ·½±ã£¬ÎÒÔÚУÄÚ×÷ÁËcopy£º
http://10.1.204.2/tool/compiler&IDE/Python-2.3.2-1.exe
linux°æ±¾µÄÎҾͲ»ËµÁË£¬ÒòΪÈç¹ûÄãÄܹ»Ê¹ÓÃlinux²¢°²×°ºÃ˵Ã÷Äã¿ÉÒÔ ......

pythonÖÐÎÄĿ¼

 ÈçÓÐһ·¾¶"e:/software/²âÊÔ.txt" 
ÐèҪͨ¹ýpyhon¶Á/д "²âÊÔ.txt"Îļþ£¬¿ÉÒÔ²ÉÓÃÏÂÃæµÄ·½·¨£º 
ipath = "e:/software/²âÊÔ.txt" 
uipath = unicode(ipath , "utf8") 
È»ºóÓÃ"uipath"¾­¹ý±àÂëºóµÄ·¾¶È¥open()¼´¿É¡£ 
ÏÂÃæÊÇÎÒÔÚÏîÄ¿ÖÐÓÃpython¶ÁдexcelµÄÒ»µãÌå»á(½â¾öÁ˶ÁÖÐÎÄÎļþà ......

python os Ä£¿é

Python 3 ½Ì³Ì¶þ:Îļþ,Ŀ¼ºÍ·¾¶
http://www.cnitblog.com/yunshichen/archive/2009/04/01/55931.html
python osÄ£¿é
http://hi.baidu.com/happynp/blog/item/729243f902d5a751242df2c2.html
http://hi.baidu.com/fiber212121/blog/item/6e07ec03c97b6982d53f7c27.html
python getoptÄ£¿é
http://www.tsnc.edu.cn/de ......

ÓÃCÓïÑÔÀ©Õ¹PythonµÄ¹¦ÄÜ


Ô­ÎÄ
PythonºÍC·Ö±ðÓÐן÷×ÔµÄÓÅȱµã£¬ÓÃPython¿ª·¢³ÌÐòËٶȿ죬¿É¿¿ÐԸߣ¬²¢ÇÒÓÐÐí¶àÏÖ³ÉÄ£¿é¿É¹©Ê¹Ó㬵«Ö´ÐÐËÙ¶ÈÏà¶Ô½ÏÂý£»CÓïÑÔÔòÕýºÃÏà·´£¬ÆäÖ´ÐÐËٶȿ죬µ«¿ª·¢Ð§Âʵ͡£ÎªÁ˳ä·ÖÀûÓÃÁ½ÖÖÓïÑÔ¸÷×ÔµÄÓŵ㣬±È½ÏºÃµÄ×ö·¨ÊÇÓÃPython¿ª·¢Õû¸öÈí¼þ¿ò¼Ü£¬¶øÓÃCÓïÑÔʵÏÖÆä¹Ø¼üÄ£¿é¡£±¾ÎĽéÉÜÈçºÎÀûÓÃCÓïÑÔÀ´À©Õ¹PythonµÄ¹¦ ......

pythonÄ£¿éÖ®MySQLdb: ÓÃpythonÁ¬½ÓmysqlÊý¾Ý¿â

mysqlÊÇÒ»¸öÓÅÐãµÄ¿ªÔ´Êý¾Ý¿â£¬ËüÏÖÔÚµÄÓ¦Ó÷dz£µÄ¹ã·º£¬Òò´ËºÜÓбØÒª¼òµ¥µÄ½éÉÜÒ»ÏÂÓÃpython²Ù×÷mysqlÊý¾Ý¿âµÄ·½·¨¡£python²Ù×÷Êý¾Ý¿âÐèÒª°²×°Ò»¸öµÚÈý·½µÄÄ£¿é£¬ÔÚhttp://mysql-python.sourceforge.net/
ÓÐÏÂÔغÍÎĵµ¡£
    ÓÉÓÚpythonµÄÊý¾Ý¿âÄ£¿éÓÐרÃŵÄÊý¾Ý¿âÄ£¿éµÄ¹æ·¶£¬ËùÒÔ£¬Æäʵ²»¹ÜʹÓÃÄÄÖÖÊý¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ