上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 1,观察者模式 # coding: utf-8 ''' 观察者模式: 内容:定义对象间的一种一对多的依赖关系,当一个对象的状态发生改变时,所有依赖于他的对象都得到通知 并被自动更新,观察者模式又称“发布-订阅”模式 角色: 抽象主题:Subject 具体主题:ConcreteSubject 发布者 阅读全文
posted @ 2022-08-31 15:16 夜未央leo 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1,导入包放置顺序,使用 isort ***.py,会自动把***.py导入的包,排列的整整齐齐 使用 isort . 可以把当前目录下的每个 .py文件导入的包,都排列整齐 第一部分:标准库包 第二部分:第三方包 第三部分:本地包 2, 阅读全文
posted @ 2022-06-15 11:04 夜未央leo 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 1,利润和提成的关系如图所示,从键盘输入当月利润I,求应发放奖金总数 # coding:utf-8 x = int(input('请输入净利润:')) arr = [1000000, 600000, 400000, 200000, 100000, 0] rat = [0.01, 0.015, 0.0 阅读全文
posted @ 2022-06-12 22:59 夜未央leo 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 1,1-06_size_hint_demo from kivy.app import App class WeatherApp(App): pass if __name__ == '__main__': WeatherApp().run() main.py BoxLayout: orientatio 阅读全文
posted @ 2022-04-11 16:39 夜未央leo 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 一,安装虚拟机 1,去官网下载vmware workstation pro *(最新版本) 官网地址:https://www.vmware.com/ 下载windows还是linux版本根据自己需求 2,安装过程比较简单,不再赘叙,可以参考:https://jingyan.baidu.com/art 阅读全文
posted @ 2022-04-07 17:58 夜未央leo 阅读(6177) 评论(0) 推荐(0) 编辑
摘要: # coding: utf-8import time, pyvisa, wexpectfrom datetime import datetime as dt, datetimeOK = 0ERROR = 1class Wrapped: def __getattr__(self, name): ret 阅读全文
posted @ 2022-03-29 10:53 夜未央leo 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 多次拷贝 import os import threading def copy_file(source_path, dest_path): with open(source_path,'rb') as soure_file: with open(dest_path,'wb') as dest_fi 阅读全文
posted @ 2022-02-18 00:24 夜未央leo 阅读(161) 评论(0) 推荐(1) 编辑
摘要: 客户端向服务端获取数据实例: # coding: utf-8 import time import socket from struct import * def connect(host, port): # create socket s = socket.socket(socket.AF_INE 阅读全文
posted @ 2022-02-07 10:26 夜未央leo 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 1,查询U盘剩余空间大小 st = os.statvfs('/media/usb0/') free = (st.f_bavail*st.f_frsize)/1024/1024 # 单位是M 2,查询U盘或者某个目录/文件大小 size = os.path.getsize('/media/usb0/m 阅读全文
posted @ 2022-01-27 18:20 夜未央leo 阅读(54) 评论(0) 推荐(0) 编辑
摘要: # -!- coding:utf-8 -!-import pandas as pdfrom datetime import date, timedelta# 1,创建excel表格,简单放入数据df = pd.DataFrame({'ID':[1,2,3],'name':['AA','BB','CC 阅读全文
posted @ 2021-12-21 10:07 夜未央leo 阅读(154) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页