锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲成人高清在线观看,亚洲成a人片在线观看久,亚洲AV成人片色在线观看高潮http://www.tkk7.com/jefflee/category/32448.htmlzh-cnSat, 21 Jun 2008 05:22:39 GMTSat, 21 Jun 2008 05:22:39 GMT60Python 甯哥敤妯″潡鍦ㄧ嚎鏂囨。http://www.tkk7.com/jefflee/archive/2008/06/21/209661.htmlJeff LeeJeff LeeSat, 21 Jun 2008 03:10:00 GMThttp://www.tkk7.com/jefflee/archive/2008/06/21/209661.htmlhttp://www.tkk7.com/jefflee/comments/209661.htmlhttp://www.tkk7.com/jefflee/archive/2008/06/21/209661.html#Feedback0http://www.tkk7.com/jefflee/comments/commentRss/209661.htmlhttp://www.tkk7.com/jefflee/services/trackbacks/209661.htmlhttp://pydoc.org/2.5.1/os.html

os.name鐨勫鹼細
windows錛歯t
linux錛歱osix

2銆乻ys: http://pydoc.org/2.5.1/sys.html


Jeff Lee 2008-06-21 11:10 鍙戣〃璇勮
]]>
Python Native Datatypes -- tuplehttp://www.tkk7.com/jefflee/archive/2007/08/28/209670.htmlJeff LeeJeff LeeTue, 28 Aug 2007 13:11:00 GMThttp://www.tkk7.com/jefflee/archive/2007/08/28/209670.htmlhttp://www.tkk7.com/jefflee/comments/209670.htmlhttp://www.tkk7.com/jefflee/archive/2007/08/28/209670.html#Feedback0http://www.tkk7.com/jefflee/comments/commentRss/209670.htmlhttp://www.tkk7.com/jefflee/services/trackbacks/209670.html Example 3.15 Defining a tuple Python Native Datatypes -- listhttp://www.tkk7.com/jefflee/archive/2007/08/27/209671.htmlJeff LeeJeff LeeMon, 27 Aug 2007 13:11:00 GMThttp://www.tkk7.com/jefflee/archive/2007/08/27/209671.htmlhttp://www.tkk7.com/jefflee/comments/209671.htmlhttp://www.tkk7.com/jefflee/archive/2007/08/27/209671.html#Feedback0http://www.tkk7.com/jefflee/comments/commentRss/209671.htmlhttp://www.tkk7.com/jefflee/services/trackbacks/209671.html Example 3.6 Defining a List 1銆乴ist鐨勫厓绱犳槸鏈夊簭鐨?br />2銆乴ist鍙互褰撴垚鏁扮粍鏉ョ敤錛屽厓绱犱笅鏍囦粠0寮濮?br />
Example 3.7 Negative List Indices
3銆乴ist鐨勭儲寮曞彲浠ユ槸璐熸暟錛岃〃杈懼紡L[n]鐨勫惈涔変負錛?br />錛?錛夊綋0 <= n <= len(L)-1 鏃訛紝 璺焜ava銆丆涓殑鏁扮粍鍏冪礌绱㈠紩涓鏍?br />錛?錛夊綋-len(L) <= n <= -1 鏃? L[n] = L[len(L)+n]
錛?錛塶涓嶅啀涓婅堪鑼冨洿鍐呮槸錛岀▼搴忓紩鍙慖ndexError
Slicing a list
榪愯緇撴灉錛?br />
榪愯緇撴灉
4銆丩[a:b]錛堝叾涓璦,b涓烘暣鏁幫級琛ㄧず涓涓垎鐗囨搷浣滐紝娉ㄦ剰a錛宐鍙互鏄換鎰忕殑鏁存暟錛岃屼笖鍒嗙墖鎿嶄綔姘歌繙涓嶄細寮曞彂IndexError銆備絾鏄痑錛宐鍙栦笉鍚岀殑鍊兼椂錛岀▼搴忚涓虹◢鏈変笉鍚屻?br />錛?錛夊綋 0 <= a < b < len(L)鏃訛紝L[a:b]榪斿洖涓涓敱L[a], L[a+1]...L[b-1]緇勬垚鐨刲ist
錛?錛夊綋 0 <= b <= a < len(L)鏃訛紝L[a:b]榪斿洖絀虹殑list
錛?錛夊綋a錛宐鍙栧間笉鍦ㄤ笂榪拌寖鍥存椂錛屽簲鐢ㄤ互涓?鏉¤鍒欐浛鎹錛宐鐨勫鹼紝寰楀埌a錛宐鏂扮殑鍊煎悗鍐嶅簲鐢ㄤ笂闈袱鏉¤鍒欍?br />
  • 鑻?a >= len(L), 鍒?a = len(L)-1
  • 鑻?-len(L) <= a < 0, 鍒?a = len(L) + a
  • 鑻?a <聽 -len(L)錛?鍒櫬?a =聽 0
  • b鐨勬儏鍐佃窡a涓鏍?
  • 褰?a娌℃湁鎸囧畾鏃訛紝a = 0, 褰揵娌℃寚瀹氭椂錛宐=len(L)-1
5銆乤ppend鍜宔xtend鏂規硶鐨勪笉鍚岋紝鐪嬩笅渚嬪氨涓鐩簡鐒朵簡銆?br />
the difference between extend and append
娉ㄦ剰 extend鐨勫弬鏁頒笉浠呬粎鍙互鏄痩ist錛屼篃鍙互鏄竴涓猼uple, dictionary絳夊彲浠terable鐨勬暟鎹粨鏋?br />6銆?

List object methods

Method

Description

Nonmutating methods

L.count(x)

Returns the number of items of L that are equal to x.

L.index(x)

Returns the index of the first occurrence of an item in L that is equal to x, or raises an exception if L has no such item.

Mutating methods

L.append(x)

Appends item x to the end of L ; e.g., L[len(L):]=[x].

L.extend(s)

Appends all the items of iterable s to the end of L; e.g., L[len(L):]=s.

L.insert(i, x)

Inserts item x in L before the item at index i, moving following items of L (if any) "rightward" to make space (increases len(L) by one, does not replace any item, does not raise exceptions: acts just like L[i:i]=[x]).

L.remove(x)

Removes from L the first occurrence of an item in L that is equal to x, or raises an exception if L has no such item.

L.pop([i])

Returns the value of the item at index i and removes it from L; if i is omitted, removes and returns the last item; raises an exception if L is empty or i is an invalid index in L.

L.reverse( )

Reverses, in place, the items of L.

L.sort([f]) (2.3)

Sorts, in place, the items of L, comparing items pairwise via function f; if f is omitted, comparison is via the built-in function cmp. For more details, see "Sorting a list" on page 57.

L.sort(cmp=cmp, key=None, reverse=False)(2.4)

Sorts, in-place, the items of L, comparing items pairwise via the function passed as cmp (by default, the built-in function cmp). When argument key is not None, what gets compared for each item x is key(x), not x itself. For more details, see "Sorting a list" on page 57.

7銆?div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">List Operators娉ㄦ剰涓嬮潰鐨勪緥瀛愶細
Another Example
榪愯緇撴灉錛?br />
榪愯緇撴灉



Jafe 2007-08-27 21:11 鍙戣〃璇勮


Jeff Lee 2007-08-27 21:11 鍙戣〃璇勮
]]>
Python Native Datatypes -- dictionaryhttp://www.tkk7.com/jefflee/archive/2007/08/26/209673.htmlJeff LeeJeff LeeSun, 26 Aug 2007 03:31:00 GMThttp://www.tkk7.com/jefflee/archive/2007/08/26/209673.htmlhttp://www.tkk7.com/jefflee/comments/209673.htmlhttp://www.tkk7.com/jefflee/archive/2007/08/26/209673.html#Feedback0http://www.tkk7.com/jefflee/comments/commentRss/209673.htmlhttp://www.tkk7.com/jefflee/services/trackbacks/209673.html Example 3.1 Defining a Dictionary 1銆佹瘡涓涓猟ictionary涓殑姣忎竴涓猧tem灝辨槸涓瀵瑰鹼細key-value銆傚彲浠ラ氳繃key寮曠敤value錛屼絾涓嶈兘閫氳繃value寮曠敤key銆?br />2銆佹瘡涓涓猭ey鏄ぇ灝忓啓鏁忔劅鐨?br />3銆佺粰涓涓猟ictionary娣誨姞涓涓柊item錛歞ictName[newKey] = newValue銆傚鏋渘ewKey瀛樺湪錛屽垯newValue浼氳鐩栧師鏉ョ殑value銆傝繖涔熻〃鏄庢坊鍔犮佷慨鏀筰tem鐢ㄧ殑鏄浉鍚岀殑璇硶銆?br />4銆乿alue鐨勭被鍨嬪彲浠ユ槸浠繪剰鐨勶紝鍚屼竴涓猟ictionary涓殑value鐨勭被鍨嬪茍涓嶉渶瑕佷竴鑷淬俴ey鐨勭被鍨嬪繀欏繪槸鎵鏈変笉鍙彉鐨勭被鍨嬶紝tuple鏈夋椂涔熷彲浠ヤ綔涓簁ey錛岃繖鏃跺檛uple涓嶈兘鍖呭惈鍙彉綾誨瀷錛屼笉綆℃槸鐩存帴鍖呭惈榪樻槸闂存帴鍖呭惈銆?br />5銆乨el D[k]鍒犻櫎涓涓猭ey鏄痥鐨刬tem銆?br />6銆佹搷浣?k in D 鍙互鐢ㄦ潵媯鏌?font color="#ff0000">key k 鏄惁鍖呭惈鍦―鐨勬墍鏈塳eys涓?br />7
Dictionary object methods

Method

Description

Nonmutating methods

D.copy( )

Returns a shallow copy of the dictionary (a copy whose items are the same objects as D's, not copies thereof)

D.has_key(k)

Returns TRue if k is a key in D; otherwise, returns False, just like kinD

D.items( )

Returns a new list with all items (key/value pairs) in D

D.keys( )

Returns a new list with all keys in D

D.values( )

Returns a new list with all values in D

D.iteritems( )

Returns an iterator on all items (key/value pairs) in D

D.iterkeys( )

Returns an iterator on all keys in D

D.itervalues( )

Returns an iterator on all values in D

D.get(k[,x])

Returns D[k] if k is a key in D; otherwise, returns x (or None, if x is not given)

Mutating methods

D.clear( )

Removes all items from D, leaving D empty

D.update(D1)

For each k in D1, sets D[k] equal to D1[k]

D.setdefault(k[,x])

Returns D[k] if k is a key in D; otherwise, sets D[k] equal to x and returns x

D.pop(k[,x])

Removes and returns D[k] if k is a key in D; otherwise, returns x (or raises an exception if x is not given)

D.popitem( )

Removes and returns an arbitrary item (key/value pair)





Jafe 2007-08-26 11:31 鍙戣〃璇勮


Jeff Lee 2007-08-26 11:31 鍙戣〃璇勮
]]>
Python: Your First Python Programhttp://www.tkk7.com/jefflee/archive/2007/08/25/209672.htmlJeff LeeJeff LeeSat, 25 Aug 2007 14:46:00 GMThttp://www.tkk7.com/jefflee/archive/2007/08/25/209672.htmlhttp://www.tkk7.com/jefflee/comments/209672.htmlhttp://www.tkk7.com/jefflee/archive/2007/08/25/209672.html#Feedback0http://www.tkk7.com/jefflee/comments/commentRss/209672.htmlhttp://www.tkk7.com/jefflee/services/trackbacks/209672.html Example 2.1 odbchelper.py 1銆佸嚱鏁幫紙function)瀹氫箟鏃犻渶鎸囧畾榪斿洖綾誨瀷銆備簨瀹炰笂錛屾墍鏈塸ython鍑芥暟閮戒細榪斿洖涓涓箋傚綋浣犵殑鍑芥暟瀹氫箟娌℃湁return璇彞鏃訛紝鍑芥暟灝嗚繑鍥濶one銆傚涓嚱鏁板弬鏁?function argument)鐢ㄩ楀彿闅斿紑銆傦紙榪欓噷鏈変竴涓枒闂紝涓轟粈涔堟槸function argument鑰屼笉鏄痜unction parameter鍛紵@@錛?br />2銆丳ython鏄竴涓姩鎬佺殑銆?b>寮虹被鍨?/font>鐨勮璦錛坉ynamically聽 & strongly type language)
3銆佹敞閲婂嚱鏁幫細錛坉ocumenting function)浠?""寮濮嬶紝浠?""緇撴潫錛屽彲浠ラ氳繃鍐呭緩灞炴?__doc__ 鑾峰緱銆傝屼笖娉ㄩ噴蹇呴』鍦ㄥ嚱鏁版渶寮濮嬮儴鍒嗗厛瀹氫箟錛屽惁鍒欒皟鐢╛_doc__鏃朵綘灝嗗緱鍒癗one.
4銆丒verything is a object!
5銆乮f __name__ == "__main__":
榪欐槸鍦ㄦ祴璇曟ā鍧椼傚湪涓婁緥涓綋妯″潡鐙珛榪愯鏃訛紝妯″潡鐨勫唴寤哄睘鎬?__name__ == "__main__"錛屽綋妯″潡琚玦mport鏃訛紝__name__ == "odbchelper"



Jafe 2007-08-25 22:46 鍙戣〃璇勮


Jeff Lee 2007-08-25 22:46 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲Aⅴ无码专区在线观看q| 国产亚洲大尺度无码无码专线| 亚洲精品不卡视频| 最近免费mv在线观看动漫 | 亚洲精品一品区二品区三品区| 水蜜桃视频在线观看免费| 国产成人免费一区二区三区| 亚洲精品国产高清在线观看| 日本免费v片一二三区| 亚洲av片在线观看| 亚洲第一成人影院| 日韩精品无码免费专区网站| 亚洲av无码潮喷在线观看| 免费A级毛片无码A∨ | vvvv99日韩精品亚洲| 日韩电影免费在线观看网址| JLZZJLZZ亚洲乱熟无码| 免费看黄的成人APP| 精品亚洲成a人片在线观看| 免费在线看v网址| 亚洲欧美熟妇综合久久久久| 免费一级成人毛片| 久久er国产精品免费观看8| 久久久久亚洲AV成人无码| 中文字幕免费在线看线人 | 亚洲国产夜色在线观看| 精品国产麻豆免费网站| 5555在线播放免费播放| 亚洲AV无码国产丝袜在线观看| 日韩av无码久久精品免费| 亚洲日产2021三区| 日日夜夜精品免费视频| 最新亚洲成av人免费看| 亚洲综合男人的天堂色婷婷| 国产免费人成视频在线观看| 中文无码日韩欧免费视频| 亚洲午夜电影在线观看高清| 波多野结衣视频在线免费观看| 可以免费观看的国产视频| 亚洲精品无码日韩国产不卡av| 曰韩亚洲av人人夜夜澡人人爽|