摘要: def generator(): for i in range(10): yield iret = generator()print(ret.__next__())print(ret.__next__())print(ret.__next__()) 加上yield就变成生成器函数了,返回值是yiel 阅读全文
posted @ 2019-11-25 13:50 不帅用砖拍 阅读(85) 评论(0) 推荐(0) 编辑
摘要: At first, you should install Django module: This may not work: pip3 install Django You should try the code below: sudo python3 -m pip install django - 阅读全文
posted @ 2019-11-18 14:15 不帅用砖拍 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1、0.1版本 1 import os 2 3 4 def show_files(path, all_files): 5 # 首先遍历当前目录所有文件及文件夹 6 file_list = os.listdir(path) 7 # 准备循环判断每个元素是否是文件夹还是文件,是文件的话,把名称传入lis 阅读全文
posted @ 2019-11-04 17:14 不帅用砖拍 阅读(2863) 评论(0) 推荐(0) 编辑
摘要: 废话不说,先上代码: 1 import os 2 3 4 def show_files(path, all_files): 5 # 首先遍历当前目录所有文件及文件夹 6 file_list = os.listdir(path) 7 # 准备循环判断每个元素是否是文件夹还是文件,是文件的话,把名称传入 阅读全文
posted @ 2019-11-04 16:07 不帅用砖拍 阅读(19645) 评论(0) 推荐(1) 编辑
摘要: 首先,导入os模块 1 import os 获取当前文件所在文件夹的路径,getcwd() 更改当前目录:chdir() 创建文件夹,mkdir() 获取文件夹下所有子文件夹及文件,listdir() 判断是否是文件夹os.path.isdir() 更改文件名称,rename(old_name, n 阅读全文
posted @ 2019-11-04 11:49 不帅用砖拍 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 报错的形式: vim : 依赖: vim-common (= 2:7.3.429-2ubuntu2) 但是 2:7.3.429-2ubuntu2.1 正要被安装 处理办法如下: sudo apt-get purge vim-common sudo apt-get update sudo apt-ge 阅读全文
posted @ 2019-10-29 19:45 不帅用砖拍 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 天从虚拟机里边安装了一下Centos,好长时间没学习了,以前的Centos都删掉了,这种态度很难掌握这个操作系统的。 下边是今天安装chrome的步骤,都是从网络搜索的,自己没啥贡献。 1、从官网下载rpm包 2、 rpm -ivh google-chrome-stable_current_x86_ 阅读全文
posted @ 2019-10-27 16:57 不帅用砖拍 阅读(981) 评论(0) 推荐(0) 编辑
摘要: 1. 备份原镜像文件,便于后期恢复 $sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/ sudo w 阅读全文
posted @ 2019-10-27 16:33 不帅用砖拍 阅读(3219) 评论(0) 推荐(0) 编辑
摘要: CentOS7设置启动默认界面方法# systemctl get-default graphical.target graphical.target表示开机将默认进入图形界面 multi-user.target表示开机将默认进入文本界面 设置开机进入文本界面 # systemctl set-defa 阅读全文
posted @ 2018-11-16 21:49 不帅用砖拍 阅读(653) 评论(0) 推荐(0) 编辑
摘要: 1. 关于Vim vim是我最喜欢的编辑器,也是Linux下第二强大的编辑器。 虽然emacs是公认的世界第一,我认为使用emacs并没有使用vi进行编辑来得高效。 如果是初学vi,运行一下vimtutor是个聪明的决定。 (如果你的系统环境不是中文,而你想使用中文的vimtutor,就运行vimt 阅读全文
posted @ 2018-11-14 16:16 不帅用砖拍 阅读(1224) 评论(1) 推荐(0) 编辑