python相关小技巧(保持更新),,1、查看导入库的类属
python相关小技巧(保持更新),,1、查看导入库的类属
1、查看导入库的类属性、方法
python有一点感觉特别不方便的就是,不像C++指定了类型后,该类型的实例打个“.”会智能提示它含有的方法或属性
之前都是靠查看库对应的官方文档解决。这次才发现了一个新方法 help,可以列出方法和属性了
import dlibhelp(dlib.rectangles)Help on class rectangle in module dlib:class rectangle(pybind11_builtins.pybind11_object) | This object represents a rectangular area of an image. | | Method resolution order: | rectangle | pybind11_builtins.pybind11_object | builtins.object | | Methods defined here: | | __eq__(...) | __eq__(self: dlib.rectangle, arg0: dlib.rectangle) -> bool | | __getstate__(...) | __getstate__(self: dlib.rectangle) -> tuple | | __init__(...) | __init__(self: dlib.rectangle, left: int, top: int, right: int, bottom: int) -> None | | __ne__(...)
2、跳转至函数定义的源代码处
使用pycharm,按住CTRL,点击函数,会跳转至函数定义处
3、定义定长数组
import numpy as nphighlights_add = highlights_sub = np.zeros(256, dtype=np.float64)
python相关小技巧(保持更新)
相关内容
- python开发飞机大战,,1.使用pygame
- python 删除文件夹,,只能删除空文件夹,删
- python之__str__用法,, 1 class P
- python爬虫解决手机验证码问题,,一、安卓手机安装ta
- 2019年的代码都写完了吗?不如做个Python进度条看看还剩
- python isdigit()函数,python3中format函数,isdigit()
- python实现浏览器打开指定url,,关键webbrows
- Python之让 字符串内的转义字符 不做任何处理,python转
- python 取整的两种方法,python向上取整的方法,问题简介
- 人生第一个python脚本:从数据库查询数据并发送邮件,
评论关闭