上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 26 下一页
摘要: class P(object): def ff(self): print(self.__mapper__) def __str__(self): return "str..." def __repr__(self): return "repr..." if __name__ == '__main__ 阅读全文
posted @ 2021-04-07 16:47 foreast 阅读(131) 评论(0) 推荐(0) 编辑
摘要: python __getitem__()方法理解 如果在类中定义了__getitem__()方法,那么他的实例对象(假设为p)就可以这样p[key]取值。当实例对象做p[key]运算时,就会调用类中的__getitem__()方法。 class P(object): def __init__(sel 阅读全文
posted @ 2021-04-07 11:06 foreast 阅读(1372) 评论(0) 推荐(1) 编辑
摘要: configparser为python用于读取配置文件的模块,文件格式跟windows下的ini配置文件相似,可以包含一个或多个节(section), 每个节可以有多个参数(option)(键=值) 1. 准备配置文件:config_dev.ini, 文件内容: [pg] # pg配置 host=1 阅读全文
posted @ 2021-04-06 13:28 foreast 阅读(203) 评论(0) 推荐(0) 编辑
摘要: from django.core.paginator import Paginator # 创建分页器:每页N条记录 paginator = Paginator(skus, constants.GOODS_LIST_LIMIT) # 获取每页商品数据 page_skus = paginator.pa 阅读全文
posted @ 2021-04-05 19:52 foreast 阅读(1522) 评论(0) 推荐(1) 编辑
摘要: Docker和FastDFS上传和下载文件 1. Docker安装运行FastDFS 1.获取FastDFS镜像 # 从仓库拉取镜像 $ sudo docker image pull delron/fastdfs # 解压教学资料中本地镜像 $ sudo docker load -i 文件路径/fa 阅读全文
posted @ 2021-04-04 17:02 foreast 阅读(493) 评论(0) 推荐(0) 编辑
摘要: Ubuntu安装和配置ssh教程 置顶 IT观察者 2018-08-15 12:02:29 50132 收藏 61分类专栏: 工具 ubuntu 文章标签: ssh Ubuntu版权一般Ubuntu都会默认安装openssh-client,但是没有安装openssh-server。 安装ssh服务器 阅读全文
posted @ 2021-04-03 22:00 foreast 阅读(862) 评论(0) 推荐(0) 编辑
摘要: linux虚拟机关机、重启命令 clearhlj 2018-08-20 14:10:31 53806 收藏 101 一.shutdown1.shutdown -h now :立即关机2.shutdown -h 10:53:到10:53关机3.shutdown -h +10 :10分钟后自动关机4.s 阅读全文
posted @ 2021-04-03 20:52 foreast 阅读(2744) 评论(1) 推荐(1) 编辑
摘要: 容器化方案Docker 思考: FastDFS的安装步骤非常的多,涉及的依赖包也很多,当新的机器需要安装FastDFS时,是否需要从头开始安装。 我们在学习时拿到ubuntu系统的镜像,在VM虚拟机中运行这个镜像后,为什么就可以直接进行开发,而不需要重新搭建开发环境。 在工作中,如何高效的保证开发人 阅读全文
posted @ 2021-04-03 18:23 foreast 阅读(40) 评论(0) 推荐(0) 编辑
摘要: import os import sys sys.path.append(str(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) os.path.dirname获取当前文件或文件夹的上层目录 __file__当前文件 os 阅读全文
posted @ 2021-04-02 17:21 foreast 阅读(482) 评论(0) 推荐(0) 编辑
摘要: 默认情况,MySQL执行的SQL是autocommit的,SALAlchemy 查询语句也是 autocommit的,就是说如果没有明确声明事务的begin,每个单独的SQL都是一个独立的事务。但是在做交易系统时,比如银行给用户A转账给用户B时,有两个操作,从A里面减100,然后给B加100。这两个 阅读全文
posted @ 2021-04-02 09:59 foreast 阅读(87) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 26 下一页