Python查看帮助

查看所有关键字:help(‘keywords‘)

查看所有modules: help(‘modules‘),包多的话比较耗时

查看中常见的topics, help(‘topics‘)

其他help()命令:内置与非内置函数的区别

可以看到,查看keywords的帮助文档需要加上引号,而builtin functions 加与不加效果是一直的

看下运行效果:

查看对象的属性和方法,使用dir():

进一步查看属性或方法的__doc__文档:

附录,Python Built-in Functions

(来自于Python官方文档, Python 2.7.9 documentation ? The Python Standard Library ?)

引用:

  1. http://blog.csdn.net/xiemanr/article/details/22104223
  2. http://blog.csdn.net/pfanaya/article/details/7574355

?

时间: 2024-08-04 20:21:18

Python查看帮助的相关文章

Python查看MQ队列深度

分享一段代码,很简单但是也很实用. 1 #!/usr/bin/python 2 #-*- coding:gb18030 -*- 3 ''' 4 Usage: mq.py [Qmgr] 5 *get the queues' curdepth which type is local, 6 and sorted by curdepth desc. 7 Auth : [email protected] 8 ''' 9 10 import re 11 import os 12 import sys 13

用python查看URL编码的中文

什么是URL编码呢,请看https://zh.wikipedia.org/wiki/Urlencode. 有时,我们向一些网站提交中文参数时,中文是会被编码成这种格式的 "%B1%E0%C2%EB ",它的原文是"编 码",URL编码也被称为"百分号编码",是不是有很多百分号.我们常使用的"空格"的URL编码就是 "%20",但是新的 标准把"空格" 替换为 "+",

python 查看目录下所有目录和文件

python查看目录下所有的子目录和子文件 python递归便利目录结构 方法1 import json, os def list_dir(path, res): for i in os.listdir(path): temp_dir = os.path.join(path, i) if os.path.isdir(temp_dir): temp = {"dirname": temp_dir, 'child_dirs': [], 'files': []} res['child_dirs

一支烟的时间导致他错失女神,Python查看撤回消息,力挽狂澜!

2011年1月21日 微信(WeChat) 是腾讯公司于2011年1月21日推出的一个为智能终端提供即时通讯服务的免费应用程序,由张小龙所带领的腾讯广州研发中心产品团队打造 .在互联网飞速发展的下.民众的需求下,微信已经更新到2.6.2.31版本,全民微信时代.村口的张大妈,家里的老父亲都知道怎么使用微信. 微信撤回消息功能是在微信的5.3.1中新增的. 如果需要撤回微信消息,长按刚刚发出去的消息,会弹出菜单,其中有撤回选项. 点击撤回后可以看到提示,会撤回刚才发出去的最后一条微信消息. 点击确

用python查看树莓的CPU使用率

http://www.blogjava.net/fjzag/articles/317773.html http://blog.csdn.net/a6225301/article/details/47092707 http://www.iplaypy.com/code/linux/l2546.html ------------------------------------------参考上面网址 感觉使用python就像是在复习liunx操作系统知识一样.python像是一头大蟒蛇控制着一切~p

[Python]查看python路径以及安装包的路径

特别是linux系统,装了多个python,有时候找不到python的绝对路径,有时候装了个django,又找不到django安装到哪里了..当然查看的方法有很多种,这里列出几种,供没有经验的人参考下. G:\code\moniter>python -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())" C:\Python27\Lib\site-packages G:\code\m

Python查看函数代码内容

方法1:使用help(random) >>> import random >>> help(random) Help on module random: NAME random - Random variable generators. FILE c:\python27\lib\random.py # 文件存放位置 方法2:利用random.__file__查看位置,然后打开后缀名为.py的文件 >>> random.__file__ 'C:\\Pyt

python 查看所有的关键字

一 查看所有的关键字:help("keywords") Here is a list of the Python keywords.  Enter any keyword to get more help. and                 elif                import              returnas                  else                in                  tryassert      

python查看删除你微信的账号

#应用环境:python2.7 #!/usr/bin/env python# coding=utf-8from __future__ import print_function import ostry: from urllib import urlencode, quote_plusexcept ImportError: from urllib.parse import urlencode, quote_plus try: import urllib2 as wdf_urllib from c