python ÖÐÎÄÎÊÌâ
Èç¹ûPythonÔ´ÎļþÖгöÏÖÖÐÎÄ£¬ÐèÒªÔÚÔ´ÎļþµÚÒ»ÐмÓÉÏÀàËÆÈçϵĴúÂëÒ³Ö¸Á
# -*- coding:gbk -*-
Èç¹û³ÌÐòµÄÔËÐнá¹ûÖаüº¬ÖÐÎÄ£¬¿ÉÒÔÔÚ³ÌÐò¿ªÍ·°üº¬ÈçÏ´úÂ룬¾Í¿ÉÒÔÕýÈ·ÏÔʾÖÐÎĽá¹û£º
import sys
reload(sys)
sys.setdefaultencoding('gbk')
Ïà¹ØÎĵµ£º
Òª´´½¨ÄãµÄapp£¨½«djangoÅäÖõ½»·¾³±äÁ¿Ï£©
python manage.py startapp polls
ËüÃǽ«»á´´½¨Ò»¸öpollsÎļþ¼Ð£¬ÀïÃæµÄÄÚÈÝÊÇ£º
¡¡¡¡polls/
¡¡¡¡¡¡¡¡__init__.py
¡¡¡¡¡¡¡¡models.py
¡¡¡¡¡¡¡¡views.py
Õâ¸öĿ¼½á¹¹¾ÍÊÇappÓ¦ÓóÌÐò¡£
±àдÊý¾Ý¿âWebÓ¦ÓóÌÐòµÄµÚÒ»²½ÊǶ¨ÒåÄãµÄÄ£ÐͲ㗗»ù±¾ÉϾÍÊÇÄãµÄÊý¾Ý¿ ......
²âÊÔÍøÕ¾£ºBaiduÖ÷Ò³ÒÔ¼°Ïà¹ØµÄÒ³Ãæ
Ö÷Ì⣺ºÚºÐ²âÊÔ£¬¹¦ÄܲâÊÔ£¬ÐÔÄÜ/ѹÁ¦²âÊÔ£¬°²È«²âÊÔ£¬ Êý¾Ý×Öµä¹ÜÀí
1. ²âÊÔÒ³ÃæÊÇ·ñ¿É·ÃÎʵģ»
1.1 HTTP request status = 200, Ò³ÃæÏÂÔØÕýÈ·
from urllib import urlopen
# set up
url = None
# test
url = urlopen('http://www.baidu.com')
assert url.getcode() == 200
# ......
ÒÔǰҲд¹ýһЩ¹ØÓÚ vim »·¾³±äÁ¿µÄÄÚÈÝ£¬Ê¹Óà vim ºÍ python £¬Ã¿Ò»¶Îʱ¼äºó¶¼»áÓÐеÄÌå»á£¬ËùÒÔÒª²»¶Ï×ܽáÁË.
vim Õë¶Ô python µÄÍòÄܲ¹È«£º vim µ±Ç°½ø³ÌÐèÒªÕÒµ½ÏàÓ¦²¹È«Ä£¿é¿âËùÔÚλÖ㬴ËÊÇ¾ÍºÍ python µÄpath»·¾³±äÁ¿Ïà¹Ø¡£
python ´úÂëÔËÐÐʱ: ¶ÔÓÚimport µÄÄ£¿éÒ²ÐèҪȷ¶¨ËüµÄ¾ßÌåλÖÃ,python ½âÊÍÆ÷»áµ½µ±Ç°Â· ......
ÔÎĵØÖ· http://www.javaeye.com/wiki/Python/1371-python-graphics-library-pil-python-image-library-introduction
¹ØÓÚPIL¿âµÄһЩ¸ÅÄî
pilÄÜ´¦ÀíµÄͼƬ
ÀàÐÍ
pil¿ÉÒÔ´¦Àí¹âդͼƬ(ÏñËØÊý¾Ý×é³ÉµÄµÄ¿é)¡£
ͨµÀ
Ò»¸öͼƬ¿ÉÒÔ°üº¬Ò»µ½¶à¸öÊý¾ÝͨµÀ£¬Èç¹ûÕâЩͨµÀ¾ßÓÐÏàͬµÄάÊýºÍÉî¶È£¬PilÔÊÐí½«ÕâЩͨµÀ½øÐеþ¼Ó ......