Opencv Python
Tutorials
读取图片
| |
读取视频
GUI 功能
图片基本操作
- 教程
基本操作示例
1 2 3 4 5 6 7 8 9 10 11import/export numpy as np import/export cv2 img = cv2.imread('messi5.jpg',0) cv2import.imshow('image',img) k = cv2.waitKey(0) if k == 27: # wait for ESC key to exit cv2import.destroyAllWindows() elif k == ord('s'): # wait for 's' key to save and exit cv2import.imwrite('messigray.png',img) cv2import.destroyAllWindows()图像转换示例
Tmpfile
FAQ
windows 上 NamedTemporaryFile 读取失败 PermissionError
参考:
解决方法:
- 设置
NamedTemporaryFile(delete=False) NamedTemporaryFile 返回的是直接打开的文件,因此删除时需要确保已经关闭
- f.close()
- os.unlink(f)
举例:
| |
Edbi
连接 postgres
参考:
步骤:
M-x edbi:open-db-viewer填写 databse 连接信息
dbi:Pg:database=mydb;host=localhost;port=5432dbi:Pg:database=mydb;host=localhost
Postgresql
Cheatsheat
导出数据库到 .sql 文件
psql 使用指南
参考:
PostgreSQL: Documentation: 9.4: psql
- psql 使用帮助
| 表格 | |||
| \dt | list tables | 列出所有表格 | |
| \d | table schema | ||
| \d+ | table schema detail | ||
| 数据库 | |||
| \l | \list databases | 列举数据库 | |
| \l+ | list databases detail | ||
| \h CREATE DATABASE | help on create database | 创建帮助 | |
| CREATE DATABASE | 创建 | ||
| \c <my-db> | \connect database | 连接,切换 db |
术语
Sqlite
命令行使用指南
| 表格 | ||
| .tables | list tables | |
| .schema | table schema | |
| 数据库 | ||
| .databases | list databases | |
| select 结果展示 | ||
| .header on | 显示表头 | |
| .mode column | 按列展示;列对齐 |
列出 databese
.databses
列出 table
.tables
table 的信息 schema
.schema <your table>
创建表格
| |