04 2021 档案

摘要:字符串常用函数 func main() { a := "hello worldeee" fmt.Println(strings.Contains(a, "h")) // h是否存在于a s := []string{"123", "456"} fmt.Println(strings.Join(s, " 阅读全文
posted @ 2021-04-20 23:16 pythoner_wl 阅读(66) 评论(0) 推荐(0) 编辑
摘要:文件操作 func main() { // 创建文件 // 创建文件会清空已存在的文件 // 创建文件,文件路径,路径1:\\ 2:直接 / 即可 f, err := os.Create("./users/aaa.txt") if err != nil { // 文件路径不存在 // 文件无操作权限 阅读全文
posted @ 2021-04-20 23:14 pythoner_wl 阅读(58) 评论(0) 推荐(0) 编辑
摘要:水平分表 # Create your models here. from django.db import models # 得到表模型类 # name是表名,fields是字段,app_label是你的应用名(如:flow),module是应用下的模型(如:flow.models),options 阅读全文
posted @ 2021-04-20 17:23 pythoner_wl 阅读(611) 评论(0) 推荐(0) 编辑
摘要:pipenv install pipenv --python 3.6 pipenv install django==2.1.8 django-admin startproject DjangoPractice python manage.py startapp pvmi pipenv install 阅读全文
posted @ 2021-04-20 17:06 pythoner_wl 阅读(32) 评论(0) 推荐(0) 编辑
摘要:Celery 项目:多任务结构使用 目录结构: celery_project ├── celery_tasks │ ├── celery.py # 必须这个名字 │ └── tasks1.py │ └── tasks2.py ├── check_result.py # 检查结果 └── send_t 阅读全文
posted @ 2021-04-20 11:53 pythoner_wl 阅读(460) 评论(1) 推荐(0) 编辑
摘要:异常处理 panic : 相当于 python 的 raise func test111() interface{} { return 1 / 1 } func main() { a := test111() // panic("111") // 报错结束,致命错误,一般不用 相当于 raise f 阅读全文
posted @ 2021-04-15 21:11 pythoner_wl 阅读(109) 评论(0) 推荐(0) 编辑
摘要:多进程,获取结果 .get() 报错: AttributeError: Can't pickle local object 'EdgeSliceProcess.get_points..row_con_min' python闭包不支持pickle(序列化)。多进程需要函数能pickle。 有几种方式解 阅读全文
posted @ 2021-04-14 12:46 pythoner_wl 阅读(653) 评论(0) 推荐(0) 编辑
摘要:接口 type Tea struct { name string age int } type Stu struct { Tea // 匿名字段,为Tea类型,继承了Tea score int } func (s Stu) jiao() { // 值传递 s.score = 11111 fmt.Pr 阅读全文
posted @ 2021-04-12 21:47 pythoner_wl 阅读(116) 评论(0) 推荐(0) 编辑
摘要:面向对象:结构体实现 继承:匿名字段 type Tea struct { name string age int } type Stu struct { Tea // 匿名字段,为Tea类型,继承了Tea score int name string } func main() { s := Stu{ 阅读全文
posted @ 2021-04-11 15:16 pythoner_wl 阅读(84) 评论(0) 推荐(0) 编辑
摘要:package main import "fmt" func xpx(a []int){ for i := 0;i<len(a);i++{ min := a[i] for j := i+1;j<len(a);j++{ if a[j] < min{ a[i],a[j] = a[j],a[i] } } 阅读全文
posted @ 2021-04-02 18:13 pythoner_wl 阅读(57) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示