python 中help函数 函数如何调用帮助

1 help函数:查看模块、函数、变量的详细说明:
&&& help(&modules&)
Please wait a moment while I gather a list of all available modules...
BaseHTTPServer
CGIHTTPServer
ConfigParser
sitecustomize
DocXMLRPCServer
FileDialog
&&& help(&json&)
Help on package json:
/usr/lib/python2.7/json/__init__.py
MODULE DOCS
http://docs.python.org/library/json
DESCRIPTION
JSON (JavaScript Object Notation) &http://json.org& is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of the :mod:`json` library contained in Python 2.6, but maintains
compatibility with Python 2.4 and Python 2.5 and (currently) has
significant performance advantages, even without using the optional C
extension for speedups.
Encoding basic Python object hierarchies::
&&& help(json.JSONDecoder)
Help on class JSONDecoder in module json.decoder:
class JSONDecoder(__builtin__.object)
Simple JSON &http://json.org& decoder
Performs the following translations in decoding by default:
+---------------+-------------------+
+===============+===================+
+---------------+-------------------+
+---------------+-------------------+
+---------------+-------------------+
| number (int)
| int, long
+---------------+-------------------+
| number (real) | float
+---------------+-------------------+
+---------------+-------------------+
查看函数:
&&& help(json.dump)
Help on function dump in module json:
dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, **kw)
Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
``.write()``-supporting file-like object).
If ``skipkeys`` is true then ``dict`` keys that are not basic types
(``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``)
will be skipped instead of raising a ``TypeError``.
If ``ensure_ascii`` is false, then the some chunks written to ``fp``
may be ``unicode`` instances, subject to normal Python ``str`` to
``unicode`` coercion rules. Unless ``fp.write()`` explicitly
understands ``unicode`` (as in ``codecs.getwriter()``) this is likely
to cause an error.
2 dir函数:查看变量可用的函数或方法
&&& import sys
&&& dir(sys)
['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'exitfunc', 'flags', 'float_info', 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'hexversion', 'last_traceback', 'last_type', 'last_value', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'py3kwarning', 'pydebug', 'setcheckinterval', 'setdlopenflags', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions']
3 type函数:查看变量的类型
&type 'module'&
&&& type (json.__name__)
&type 'str'&
&&& type (json.decoder)
&type 'module'&
4 退出python命令行
windows: ctrl+z 回车
linux:ctrl+d&
注:使用pydoc module 可查看模块的文档说明
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:12093次
排名:千里之外
原创:16篇
转载:25篇
(1)(11)(11)(1)(5)(3)(9)当前位置:
在VB中调用HTMLHELP文件
来源: 联系QQ: 作者: 佚名 来源: 网络 发布时间: 12/10/16
湖北省襄樊市劳动保险处 闫东 ---- HTML帮助文件是WINDOWS基本帮助系统的一种新标准,在WINDOWS 98中我们到处都可以看到它的身影。作为一种时尚,我们的应用软件自然也不能够落后,于是我就着手将原来的帮助文件重新编译为HTML帮助文件。从VISUAL STUDIO 98中可以找到 HTML HELP WORKSHOP,使用方法不是太难,由于我有自己的个人网站,制作HTML 文件自然也不在话下。很快,一个帮助文件就完成了(MY.CHM)。可是,如何在VB中调用它呢? ---- 试试原来的API 函数WINHELP,提示出错信息“MY.CHM 文件不是WINDOWS帮助文件,或该文件已经损坏”。显然,WINHELP函数不认识这种新的帮助类型。查看HTML HELP WORKSHOP的帮助文件,它提示可以使用API函数HTMLHELP来调用HTML帮助文件,但只是它是按C语言的格式声明的,如下: HWND HtmlHelp(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData);---- 按照说明,参数hwndCaller是窗口的句柄,pszFile是HTML帮助文件的路径和名称, uCommand表明执行的操作,dwData是uCommand参数所必需的值。它包含在哪个文件中,如何将它转为VB的格式呢?仔细对帮助文件进行研究,帮助文件中提到:HTMLHELP函数被包含在hhctrl.ocx文件中。于是就得到了HTMLHELP函数在VB中的声明: Declare Function htmlhelp Lib&hhctrl.ocx& Alias &HtmlHelpA&(ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long---- 现在回到VB中,谈谈实际的应用。首先当然是要在工程中加入上面的声明,然后编辑工程的菜单,在“帮助”菜单的CLICK方法中加入以下的代码: &&&&htmlhelp HWND,“MY.CHM”,0,0---- 运行工程后,选择“帮助”菜单就可以显示HTML帮助文件了。&&
上一篇资讯:
下一篇资讯:
文章排行榜Help_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
上传于||文档简介
&&h​e​l​p
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 matlab help函数 的文章

 

随机推荐