python内置函数简称_Python内置函数(39)——help

英文文档:

help([object])

Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.

This function is added to the built-in namespace by the site module.

返回对象的帮助信息

说明:

1. 在解释器交互界面,不传参数调用函数时,将激活内置的帮助系统,并进入帮助系统。在帮助系统内部输入模块、类、函数等名称时,将显示其使用说明,输入quit退出内置帮助系统,并返回交互界面。

>>> help() #不带参数

Welcome to Python 3.5's help utility!

If this is your first time using Python, you should definitely check out

the tutorial on the Internet at http://docs.python.org/3.5/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing

Python programs and using Python modules. To quit this help utility and

return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type

"modules", "keywords", "symbols", or "topics". Each module also comes

with a one-line summary of what it does; to list the modules whose name

or summary contain a given string such as "spam", type "modules spam".

#进入内置帮助系统 >>> 变成了 help>

help> str #str的帮助信息

Help on class str in module builtins:

class str(object)

| str(object='') -> str

| str(bytes_or_buffer[, encoding[, errors]]) -> str

|

| Create a new string object from the given object. If encoding or

| errors is specified, then the object must expose a data buffer

| that will be decoded using the given encoding and error handler.

| Otherwise, returns the result of object.__str__() (if defined)

| or repr(object).

| encoding defaults to sys.getdefaultencoding().

| errors defaults to 'strict'.

|

| Methods defined here:

|

| __add__(self, value, /)

| Return self+value.

................................

help> 1 #不存在的模块名、类名、函数名

No Python documentation found for '1'.

Use help() to get the interactive help utility.

Use help(str) for help on the str class.

help> quit #退出内置帮助系统

You are now leaving help and returning to the Python interpreter.

If you want to ask for help on a particular object directly from the

interpreter, you can type "help(object)". Executing "help('string')"

has the same effect as typing a particular string at the help> prompt.

# 已退出内置帮助系统,返回交互界面 help> 变成 >>>

>>>

2. 在解释器交互界面,传入参数调用函数时,将查找参数是否是模块名、类名、函数名,如果是将显示其使用说明。

>>> help(str)

Help on class str in module builtins:

class str(object)

| str(object='') -> str

| str(bytes_or_buffer[, encoding[, errors]]) -> str

|

| Create a new string object from the given object. If encoding or

| errors is specified, then the object must expose a data buffer

| that will be decoded using the given encoding and error handler.

| Otherwise, returns the result of object.__str__() (if defined)

| or repr(object).

| encoding defaults to sys.getdefaultencoding().

| errors defaults to 'strict'.

|

| Methods defined here:

|

| __add__(self, value, /)

| Return self+value.

|

***************************

Python内置函数(39)——locals

英文文档: locals() Update and return a dictionary representing the current local symbol table. Free var ...

Python 内置函数sorted()在高级用法

对于Python内置函数sorted(),先拿来跟list(列表)中的成员函数list.sort()进行下对比.在本质上,list的排序和内建函数sorted的排序是差不多的,连参数都基本上是一样的. ...

Python内置函数和内置常量

Python内置函数 1.abs(x) 返回一个数的绝对值.实参可以是整数或浮点数.如果实参是一个复数,返回它的模. 2.all(iterable) 如果 iterable 的所有元素为真(或迭代器为 ...

python内置函数

python内置函数 官方文档:点击 在这里我只列举一些常见的内置函数用法 1.abs()[求数字的绝对值] >>> abs(-13) 13 2.all() 判断所有集合元素都为真的 ...

python 内置函数和函数装饰器

python内置函数 1.数学相关 abs(x) 取x绝对值 divmode(x,y) 取x除以y的商和余数,常用做分页,返回商和余数组成一个元组 pow(x,y[,z]) 取x的y次方 ,等同于x ...

Python基础篇【第2篇】: Python内置函数(一)

Python内置函数 lambda lambda表达式相当于函数体为单个return语句的普通函数的匿名函数.请注意,lambda语法并没有使用return关键字.开发者可以在任何可以使用函数引用的位 ...

[python基础知识]python内置函数map/reduce/filter

python内置函数map/reduce/filter 这三个函数用的顺手了,很cool. filter()函数:filter函数相当于过滤,调用一个bool_func(只返回bool类型数据的方法) ...

Python内置函数进制转换的用法

使用Python内置函数:bin().oct().int().hex()可实现进制转换. 先看Python官方文档中对这几个内置函数的描述: bin(x)Convert an integer numb ...

Python内置函数(12)——str

英文文档: class str(object='') class str(object=b'', encoding='utf-8', errors='strict') Return a string  ...

随机推荐

ECMAScript 6 简介

ECMAScript 6 是JavaScript的下一个标准,正处在快速开发之中,大部分已经完成了,预计将在2014年正式发布.Mozilla将在这个标准的基础上,推出JavaScript 2.0. ...

[bzoj2243][SDOI2011]染色

Description 给定一棵有$n$个节点的无根树和$m$个操作,操作有$2$类: 1.将节点$a$到节点$b$路径上所有点都染成颜色$c$; 2.询问节点$a$到节点$b$路径上的颜色段数量(连 ...

Tomcat配置虚拟主机后的登录验证码问题

先描述一下问题现象,在本地测试运行一个java web网站,一切正常.但把网站部署到Linux服务器上后,发现登录出了问题,提示验证码输入不正确.登录时需要输入验证码,而验证码的原值是先存入sessi ...

JS分割字符串并放入数组的函数

JS分割字符串并放入数组的函数: var InterestKeywordListString = $("#userInterestKeywordLabel").html();  v ...

自己动手写处理器之第四阶段(1)——第一条指令ori的实现

将陆续上传本人写的新书(尚未出版),今天是第11篇,我尽量每周四篇 第4章 第一条指令ori的实现 前面几章介绍了非常多预备知识,也描绘了即将要实现的OpenMIPS处 ...

Nexus入门指南(图文)

Nexus入门指南(图文) 博客分类: Maven JavamavenGoogleApacheTomcat Nexus介绍 Nexus 是Maven仓库管理器,如果你使用Maven,你可以从Maven ...

垂直居中小记 line-height table vertical-align:middle

垂直居中分两种情况:1.父元素高度确定的单行文本        2.以及父元素高度确定的多行文本. 1.垂直居中-父元素高度确定的单行文本的竖直居中的方法是通过设置父元素的 height 和 line ...

python初识(二)

伟大的"hello world" print("hello world") 第一个简单的python程序就搞定了 浅谈python语言的特点: 1. 语法简洁: ...

GCT学习总结

GCT的一个综合的考试性质,时间紧,题量大,这个时候需要我们快速.准确的答题,把自己的能力展现在其中,十一期间和同学们一起学习.讨论,大家都提高很大,各科谈一下自己的心得 数学: 数学相对来说还是不难 ...

IDEA 运行spring boot出现端口占用的问题

Description: The Tomcat connector configured to listen on port 8080 failed to start. The port may al ...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值