摘要: 方法一:如果/home / 挂载都是写在 fstab 里的,直接把 /opt /usr 的数据移到 /home 下,再创建一个链接就行方法二:1 .尽量的关掉不用的程序 2. 复制 代码: cd / ; sudo tar cf - usr opt | (cd /home ; sudo tar xfv 阅读全文
posted @ 2021-12-01 22:19 hans_hao 阅读(868) 评论(0) 推荐(0)
摘要: Python GUI方案选择,这个要看实际项目需求了,如果只是简单、最基本的功能,不考虑界面布局和美观程度,可以使用Python自带的GUI标准库tkinter,如果功能复杂一些,可以使用wxPython或PyQt,下面我分别简单介绍一下: 01 tkinter 这是Python自带的一个GUI标准 阅读全文
posted @ 2021-10-10 18:52 hans_hao 阅读(582) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- import shutil import os import cv2 os.chdir(os.path.split(os.path.realpath(__file__))[0]) print(os.getcwd()) dirs_path = os.ge 阅读全文
posted @ 2021-10-06 07:52 hans_hao 阅读(335) 评论(0) 推荐(0)
摘要: 将pip源更换到国内镜像用pip管理工具安装库文件时,默认使用国外的源文件,因此在国内的下载速度会比较慢,可能只有50KB/s。幸好,国内的一些顶级科研机构已经给我们准备好了各种镜像,下载速度可达2MB/s。其中,比较常用的国内镜像包括: (1)阿里云 https://mirrors.aliyun. 阅读全文
posted @ 2021-10-02 09:10 hans_hao 阅读(136) 评论(0) 推荐(0)
摘要: list1 = [] board = ['张三', '李小四', '王二麻子'] while 1: dic = {'uesername': '', 'password': ''} # 每次循环都要新定义,否则前面的字典会被刷新 user = input('请输入用户名(如果想退出则输入Q或q):') 阅读全文
posted @ 2021-06-12 22:08 hans_hao 阅读(969) 评论(0) 推荐(0)
摘要: # n_and_p = [{'dog1':'123'},{'dog2':'234'},{'dog3':'345'},{'dog4':'456'},{'dog5':'567'},{'dog6':'678'},{'dog7':'789'},] # with open('E:/dog.txt',mode= 阅读全文
posted @ 2021-06-09 00:49 hans_hao 阅读(70) 评论(0) 推荐(0)
摘要: ascii:字母,数字,特殊字符:1个字节,8位Unicode:16位 两个字节 升级 32 位 四个字节(就这两个类型)(python3中是默认的)utf-8:最少一个字节 8位表示。 英文字母 8位 1个字节 欧洲16位,2个字节 中文24位,3个字节gbk:中文2个字节,英文字母1个字节。 阅读全文
posted @ 2021-05-31 21:09 hans_hao 阅读(71) 评论(0) 推荐(0)
摘要: s = 'qwERTyuio' s1 = s.capitalize() #首字母大写,其余小写 s2 = s.title() #用特殊字符和数字分开的单词,首字母大写 s3 = s.swapcase() #大小写反转 s4 = s.center(20) #居中 s5 = s.startswith(' 阅读全文
posted @ 2021-05-30 08:21 hans_hao 阅读(69) 评论(0) 推荐(0)
摘要: 此次用了while--else循环,如果while中不是从break中退出,则转到else中执行语句。 %s占位符的使用:print(“%s” % (...)) name = 'hans' password = "123456" i = 0 while i < 3: namer = input("请 阅读全文
posted @ 2021-05-29 17:01 hans_hao 阅读(73) 评论(0) 推荐(0)
摘要: 逻辑运算优先级: print(0 or 3) print(0 or 0) print(3 or 0) print(9 or 8) print(1 and 2) print(2 and 1) print(0 and 1) print(1 and 0) 显示结果为: 1 3 2 0 3 3 4 9 5 阅读全文
posted @ 2021-05-29 15:36 hans_hao 阅读(247) 评论(0) 推荐(0)