午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁技術文章
文章詳情頁

python的help函數如何使用

瀏覽:180日期:2022-07-21 15:21:28

help函數是python的一個內置函數,在python基礎知識中介紹過什么是內置函數,它是python自帶的函數,任何時候都可以被使。help函數能作什么、怎么使用help函數查看python模塊學習中函數的用法,和使用help函數時需要注意哪些問題,下面來簡單的說一下。

help函數能作什么

在使用python來編寫代碼時,會經常使用python調用函數、自帶函數或模塊,一些不常用的函數或是模塊的用途不是很清楚,這時候就需要用到help函數來查看幫助。

這里要注意下,help()函數是查看函數或模塊用途的詳細說明,而dir()函數是查看函數或模塊內的操作方法都有什么,輸出的是方法列表。

怎么使用help函數查看python模塊中函數的用法

help( )括號內填寫參數,操作方法很簡單。

使用help函數查看幫助時需要注意哪些問題

在寫help()函數使用方法時說過,括號中填寫參數,那在這里要注意參數的形式:

1、查看一個模塊的幫助

>>>help(’sys’)

之后它回打開這個模塊的幫助文檔

2、查看一個數據類型的幫助

>>>help(’str’)

返回字符串的方法及詳細說明

>>>a = [1,2,3]>>>help(a)

這時help(a)則會打開list的操作方法

>>>help(a.append)

會顯示list的append方法的幫助。

實例擴展:

怎么使用help函數查看python模塊中函數的用法

help()括號內填寫參數,操作方法很簡單。例如:

>>> help(’dir’)Help on built-in function dir in module builtins:dir(...) dir([object]) -> list of strings If called without an argument, return the names in the current scope. Else, return an alphabetized list of names comprising (some of) the attributes of the given object, and of attributes reachable from it. If the object supplies a method named __dir__, it will be used; otherwise the default dir() logic is used and returns: for a module object: the module’s attributes. for a class object: its attributes, and recursively the attributes of its bases. for any other object: its attributes, its class’s attributes, and recursively the attributes of its class’s base classes.

到此這篇關于python的help函數如何使用的文章就介紹到這了,更多相關如何使用python的help函數內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 中文一区在线 | 亚洲欧洲成人 | 成年人黄色一级片 | 超碰10000| 国产精品视频在线免费观看 | 亚洲无av在线中文字幕 | 日韩二区三区 | 欧美一区一区 | 天天爽视频| 国产成人精品123区免费视频 | 天堂在线一区二区 | 91网站免费看 | 久草日韩 | 成人av网址在线观看 | 国内一区二区 | 日本一级一片免费视频 | 91爱爱网站 | 日韩精品视频中文字幕 | 鲁大师在线高清在线播放免费观看 | 全部免费毛片在线播放一个 | 日韩 国产 在线 | 亚洲成人精品在线观看 | 成人做受黄大片 | 国产精品视频在线观看 | 亚洲网在线观看 | 日韩中文字幕在线视频 | 亚洲最新偷拍 | 天天操夜| 亚洲欧美日本在线 | 欧美日韩一级在线 | 青草全福视在线 | 在线播放网址 | 日韩美女中文字幕 | 欧美草草 | 午夜亚洲国产 | 国产精品久久久久影院 | 日韩精品中文字幕一区二区 | a毛片网站 | 播放黄色一级片 | 欧美日韩中文字幕一区二区三区 | www一级片 |