python3学习手册
串,功能和"str".format()类似 name = "cof-lee" print(f"这是{name}") 结果: 这是cof-lee ★第8章、面向对象 类是由 数据结构 及对数据进行的操作方法 组成的 ①创建类 class 类名称: "类的帮助信息,描述" 类的内容 class 类名称(基类1, 基类2): #派生类 类的方法即类里的函数,python的类方法必须有一个额外的第一个参 数,类方法第一个参数名为self,表示类的实例(对象),而非类本身 定义时有self,但在使用类方法时,不用再写这个参数! 对象:通过类定义的数据结构实例 ③构造函数 __init__(self) #init前后各2个下划线 class MyClassA: xxx = 4 # 类变量,它的值在这个类的所有实例间共 , unpack(), calcsize() struct.pack('fmt', v1, v2, ...) #按照给定的格式(fmt),把数据封装成 bytes(实际上是类似于c结构体的字节流) struct.unpack('fmt', bytesxx) #按照给定的格式(fmt)解析bytes,返回 解析后的tuple struct.calcsize('fmt')0 码力 | 213 页 | 3.53 MB | 1 年前3k8s操作手册 2.3
unix:///var/run/cri-dockerd.sock 相 当 于 v1.23 及 之 前 版 本 的 的 unix:///var/run/dockershim.sock 不过,不建议使用了,调用层次太多,本小节仅供学习测试 首先安装docker # yum install docker-ce # systemctl enable docker # systemctl start -n xxx #回滚到指定历史版本 ★制作包 # helm create test-chart #创建一个chart项目目录,默认结构如下: # tree test-chart/ test-chart/ ├── charts ├── Chart.yaml ├── templates │ ├── deployment.yaml0 码力 | 126 页 | 4.33 MB | 1 年前3postgresql操作手册
#创建名 为tablexx的表,3个字段 db_test=# \d tablexx; #查看表结构 Table "public.tablexx" Column | Type | Colla�on | Nullable | ★说明: "public"."tablexx"中的public不是数据库名称,而是schemaname,后面 的tablexx为表名称 pg数据库,使用HeidiSQL连接到某个库后,一个数据库的结构为: 默认有4个schema,所有的表默认在名为public的schema下 ★存储空间使用量查询 postgres=# select pg_size_pre�y(pg_tab ★第8章、表 数据操作 db_test=# \d tablexx; #查看表结构 Table "public.tablexx" Column | Type | Colla�on | Nullable |0 码力 | 17 页 | 445.84 KB | 1 年前3
共 3 条
- 1