PythonѧϰÔý¼Ç
Ubuntuƽ̨ϵÄPython²Ù×÷Mysql
1.°²×°Ubuntu,°²×°Msql.
2.´ò¿ªÖÕ¶Ë,ÊäÈë python
import MySQLdb
con = MySQLdb.connect(db="python")
cur = con.cursor()
count = cur.execute("select * from test")
print count
data = cur.fetchall()
print data
for d in data:
print d
import os
os.system('clear') # clear screen
count = cur.execute("delete from test where id =1")
print count
count = cur.execute("select * from test")
print count
cur.close()
con.commit()
con.close()
ps.pythonѧϰÊé¼®
1.python¼òÃ÷½Ì³Ì
http://www.woodpecker.org.cn:9081/doc/abyteofpython_cn/chinese/
2.pythonºËÐıà³Ì(µÚ¶þ°æ)
Ïà¹ØÎĵµ£º
½ñÌìѧϰÁËÒ»ÏÂPythonµÄ²Ù×÷·ûÖØÔØ£¬×ܽáÁ˼¸µã±È½ÏÉñÆæµÄ¶«¶«£º
------------------------------------------------------------------------------------------------------------
¹ØÓÚiter£º
Technically, iteration contexts work by calling the iter built-in function to try to
find an _ _iter_ _ method, whi ......
×î½ü¿´¿É°®µÄpython£¬ÀïÃæÓкܶàÒÔǰûÓÐ×¢ÒâµÄ¶«Î÷¡£ÊéÊǽèµÄ£¬ÆÚ´ýµ½2ÔÂ27ºÅ£¬ÉçÇø½â³ýͼÊ龲Ĭ¡£
ͼÊé´ó¸Å·ÖÁË3¸ö²¿·Ö¡£µÚÒ»²¿·ÖÖ÷ÒªÊDZ¾µØ±à³ÌµÄ¹ý³Ì£¬µÚ¶þ²¿·ÖÖ÷ÒªÊÇÍøÒ³±à³Ì¡£µÚÈý²¿·ÖÊÇСֽÌõ£¬
ÌṩÁ˺ܶà֪ʶµãµÄËټǡ£
ÒÔǰҲÉϹýwoodpecker£¬ÕýÈçÍøÕ¾ÉÏдµÄ£¬È·ÊµºÜÂÒ¡£ÎÒ¾³£²»ÖªµÀ¿´ÄÄ£¬Õâ¸öÖ»Äܶà¹ä¡£ÊéÖÐ ......
1.1. Óï·¨
1.1.1. if
>>> x=int(raw_input("please enter an integer:"))
please enter an integer:-8
>>> if x<0:
... print 'negative'
... elif x==0:
... print 'zero'
... else:
... print 'positive'
...
negative
ÕâÀïÓм¸¸ö֪ʶµãÐèÒªÌáÐÑ£º
1¡£ºÍ ......
python_¸´ÔÓÊý¾ÝÀàÐÍ
pythonÖÐÔÉúµÄ¶ÓÁÐÓÐ2ÖÖ£¬Ò»ÖÖÊÇÆÕͨµÄ¶ÓÁÐ(Queue)£¬Ò»ÖÖ½Ð×öÓÅÏȶÓÁÐ(PriorityQueue)£¬¼´Ð¡µÄÏȳöÁС£
×¢Ò⣺¶ÓÁÐÊÇḬ̈߳²È«µÄ£¬python 3.0ÖÐÖ§³Ö¶à½ø³Ì£¬Ò²ÓÐÀàËÆµÄQueue£¬µ«²»ÊÇÕâ¸ö¡£
1Õ»¡¢¶ÓÁС¢¶Ñ
pythonÖÐÔÉúµÄ¶ÓÁÐÓÐ2ÖÖ£¬Ò»ÖÖÊÇÆÕͨµÄ¶ÓÁÐ(Queue)£¬Ò»ÖÖ½Ð×öÓÅÏȶÓÁÐ(PriorityQueu ......
¡¡¡¡½ÓÏÂÀ´ÈýÐÐÉèÖÃÈýÖÖ¹¦ÄÜ£¬treeview.set_search_column(0)£¬µ±ÔÚ½çÃæÖа´“Control+F”ʱ¿ÉÒÔËÑË÷µÚ0ÁÐÖеÄÄÚÈÝ£¬tvcolumn.set_sort_column_id(0)£¬µ±µã»÷´ËÁбêÌâµÄʱºòËùÓеÄÐа´´óС˳ÐòÖØÐÂÅÅÁС£²ÎÊý0ÊÇ
ÁÐÔÚModelÀïµÄÐòºÅ¡£½ÓÏÂÀ´treeview.set_reorderable·½·¨Ê¹µÃ¿ÉÒÔÓÃÊó±êÍ϶¯ÐнøÐÐÖØÐÂÅÅÁУ¬±ÈÈç£ ......