Error in user YAML: (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1
---
- oeasy Python 0518
- 这是 oeasy 系统化 Python 教程,从基础一步步讲,扎实、完整、不跳步。愿意花时间学,就能真正学会。
本教程同步发布在:
个人网站: `https://oeasy.org`
蓝桥云课: `https://www.lanqiao.cn/courses/3584`
GitHub: `https://github.com/overmind1980/oeasy-python-tutorial`
Gitee: `https://gitee.com/overmind1980/oeasypython`
---- 次安装了
- postgres数据库
- sqlalchemy包
- sqlalchemy如何对postgresql数据库点石成金呢?
- 确认服务、库、表都ok
- 开始编辑py文件
- 尝试连接
- 什么是引擎呢?
- engine
- 自己能够跑起来的东西
- 带动整个车船运动的核心
from sqlalchemy import create_engine
engine = create_engine("sqlite+pysqlite:///:memory:", echo=True)
- 这个代码会建立一个在内存中的引擎
- 可以建立一个postgresql的引擎吗?
- 貌似可以建立一个pg的引擎
- 使用postgres+psycopg2作为驱动
- 字符串好长
- 这都什么含义呢?
- 驱动
- 用户名
- 密码
- 主机地址和端口
- 数据库名称
- postgres的密码还得修改一下
- 运行时报错
- 运行不报错
- 说明引擎已经可以发动起来了
- 我们下次再说
- 本文来自 oeasy Python 系统教程。
- 想完整、扎实学 Python,
- 搜索 oeasy 即可。









