新聞中心
大多數(shù)的cheatsheet都是簡(jiǎn)單的語(yǔ)法規(guī)則列表,如果你手頭有一份cheatsheet會(huì)讓你的工作效率大大提升。

站在用戶的角度思考問(wèn)題,與客戶深入溝通,找到灣里網(wǎng)站設(shè)計(jì)與灣里網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站制作、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、虛擬主機(jī)、企業(yè)郵箱。業(yè)務(wù)覆蓋灣里地區(qū)。
近日,有一叫Python-cheatsheet項(xiàng)目在Hacker News、Reddit、Github等網(wǎng)站上成功引起了廣大程序員的注意。
Python-cheatsheet是一份超全的Python速查表,最大的特點(diǎn)就是你無(wú)需安裝和配置,在線就能使用,內(nèi)容十分全面
目前,python-cheatsheet已經(jīng)過(guò)在Github上獲得 7885 個(gè)Star,1572 個(gè)Fork(Github地址:https://github.com/gto76/python-cheatsheet)
清單的開(kāi)頭就對(duì)這份內(nèi)容進(jìn)行一個(gè)梳理,可以看出內(nèi)容涵蓋:容器、類型、語(yǔ)法、系統(tǒng)、數(shù)據(jù)、庫(kù),以及Advanced Python等。你只要點(diǎn)擊相關(guān)知識(shí)點(diǎn),就會(huì)跳轉(zhuǎn)到相關(guān)的詳情頁(yè),下面以Main和List為例
Main
if __name__ == '__main__': # Runs main() if file wasn't imported.
main()
List
=
[from_inclusive : to_exclusive : ±step_size]
.append(
) # Or: += [
] .extend(
) # Or: +=
.sort()
.reverse()
= sorted(
) = reversed( )
sum_of_elements = sum()
elementwise_sum = [sum(pair) for pair in zip(list_a, list_b)]
sorted_by_second = sorted(, key=lambda el: el[1])
sorted_by_both = sorted(, key=lambda el: (el[1], el[0]))
flatter_list = list(itertools.chain.from_iterable())
product_of_elems = functools.reduce(lambda out, x: out * x,)
list_of_chars = list()
index =.index(
) # Returns index of first occurrence or raises ValueError. .insert(index,
) # Inserts item at index and moves the rest to the right. = .pop([index]) # Removes and returns item at index or from the end.
.remove(
) # Removes first occurrence of item or raises ValueError. .clear() # Removes all items. Also works on dict and set.
整份文檔基本都是代碼,只有個(gè)別內(nèi)容會(huì)添加一些簡(jiǎn)短的文字說(shuō)明,對(duì)于用法創(chuàng)建者為了減少使用者的負(fù)擔(dān),只給了最常見(jiàn)的用法,用最簡(jiǎn)潔的方式給你最需要的用法
如果你不想在線使用該文檔,你也可以下載文本,下載地址:https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md
項(xiàng)目地址:https://github.com/gto76/python-cheatsheet
當(dāng)前標(biāo)題:7921 Star!Python學(xué)習(xí)的必備法寶,隨查隨用,太方便了吧
當(dāng)前地址:http://fisionsoft.com.cn/article/dhjjidp.html


咨詢
建站咨詢
