Python--使用技巧(查看类结构)
来源:互联网 发布:中国网络电影演员 编辑:程序博客网 时间:2024/06/08 03:29
对于我这样的初学者,大概没有比在编程中能够快速查找帮助文档更重要的事情了。
在Python命令行的编程环境中,查找类结构可以通过以下命令
import mathdir(math)['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']math.ceil.__doc__'ceil(x)\n\nReturn the ceiling of x as a float.\nThis is the smallest integral value >= x.' help(math.pow)Help on built-in function pow in module math: pow(...) pow(x, y) Return x**y (x to the power of y).
dir(math):显示math这个类的结构,包含的变量和方法
math.ceil.__doc__:ceil方法的介绍(英文两道下划线)
help(math.pow):pow方法的实现代码
阅读全文
0 0
- Python--使用技巧(查看类结构)
- python使用技巧(一)
- Python使用技巧(0)
- 使用Eclispe 查看api技巧
- 使用Windbg查看TEB结构
- 使用windbg查看PE结构
- 使用windbg查看PE结构
- ubuntu技巧--python查看已安装包
- 使用CL.EXE查看C++中类的内存结构
- 使用CL.EXE查看C++中类的内存结构
- android studio使用-查看类结构及继承关系
- PyCharm使用技巧记录(一)如何查看变量
- PyCharm使用技巧记录(一)如何查看变量
- Python使用技巧(自定义)
- Python使用技巧
- Python使用小技巧
- python yield使用技巧
- python:科普 使用技巧
- mysql 数据迁移
- 計算機語言(程式/程序語言)介紹--Scratch 2.0
- 数据结构实验之图论十:判断给定图是否存在合法拓扑序列---bfs判断又向图的无环问题
- 这是我的第一篇博文
- JobScheduler简介
- Python--使用技巧(查看类结构)
- 进度报告——03
- Windows平台使用Gitblit搭建Git服务器中的坑
- java提取PDF文字坐标
- 360*640是什么设备的分辨率?
- python 基础知识
- 安卓生成签名和给未打包的apk签名
- 前端项目积累和总结——零碎知识(js)
- poj2985 The k-th Largest Group