摘要: class A(object): def func(self): print('A') class B(A): def func(self): super().func() print('B') class C(A): def func(self): super().func() print('C' 阅读全文
posted @ 2020-06-02 22:57 collin_pxy 阅读(159) 评论(0) 推荐(0) 编辑
摘要: client.py import socket def get_ip_status(ip, port): sk= socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sk.connect((ip, port)) # print('{0} po 阅读全文
posted @ 2020-06-02 22:54 collin_pxy 阅读(101) 评论(0) 推荐(0) 编辑
摘要: client.py import socket import struct sk=socket.socket() sk.connect(('127.0.0.1',9005)) while True: username=input("请输入用户名: ") password=input("请输入密码: 阅读全文
posted @ 2020-06-02 22:51 collin_pxy 阅读(893) 评论(0) 推荐(0) 编辑
摘要: # sys.argv练习 # 写一个python脚本,在cmd里执行 # python xxx.py 用户名 密码 cp 文件路径 目的地址 # python xxx.py alex sb cp D:\python_22\day22\1.内容回顾.py D:\python_22\day21 # py 阅读全文
posted @ 2020-06-02 22:46 collin_pxy 阅读(302) 评论(0) 推荐(0) 编辑
摘要: # sys.argv练习 # 写一个python脚本,在cmd里执行: python xxx.py 用户名 密码 cp 文件路径 目的地址 python xxx.py alex sb cp D:\python_22\day22\1.内容回顾.py D:\python_22\day21 python 阅读全文
posted @ 2020-06-02 22:45 collin_pxy 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 组合: 一个类的对象是另外一个类对象的属性 # 组合 # 一个类的对象是另一个类对象的属性 # 什么时候使用组合:当两个类之间的关系是 :什么有什么的关系 : 班级有学生 学生有班级 班级有课程 图书有作者 学生有成绩 # 组合: 一个类的对象是另外一个类对象的属性 class Grade(): d 阅读全文
posted @ 2020-06-02 22:43 collin_pxy 阅读(94) 评论(0) 推荐(0) 编辑
摘要: # @ Author : Collin_PXY # Python 正则表达式的应用(二) # 正则表达式之所以让人头疼,很大程度是因为表达式里有大量的符号及它们的组合,还有很多匹配模式,想要记住比较困难。 # 总结一下,方便用到的时候查询。 # 1--特殊字符表: # \d 0~9 的整数字元 # 阅读全文
posted @ 2020-06-02 22:37 collin_pxy 阅读(131) 评论(0) 推荐(0) 编辑
摘要: # @ Author : Collin_PXY # 正则表达式: import re # 1,分步写法: # 1)rule.search(string) pattern='各小区' rule=re.compile(pattern) tel=rule.search(string) # 返回第一个匹配的 阅读全文
posted @ 2020-06-02 22:35 collin_pxy 阅读(106) 评论(0) 推荐(0) 编辑
摘要: udp-一定是client端先发送数据。 server.py import socket friend_lst = {'alex':'32','太白':'33'} sk =socket.socket(type=socket.SOCK_DGRAM) sk.bind(('127.0.0.1',9001) 阅读全文
posted @ 2020-06-02 22:31 collin_pxy 阅读(192) 评论(0) 推荐(0) 编辑
摘要: def login(): # 登录 # 登录 输入用户名密码 # 和self.user_list作比对 while True: username = input('用户名 :') # password = input('密 码 :') # user_list=SC.getallstudents() 阅读全文
posted @ 2020-06-02 22:25 collin_pxy 阅读(202) 评论(0) 推荐(0) 编辑
摘要: server.py import json import struct import socket # 接收 sk = socket.socket() # sk.bind(('127.0.0.1',9001)) sk.bind(('192.168.31.159',9005)) sk.listen() 阅读全文
posted @ 2020-06-02 22:24 collin_pxy 阅读(109) 评论(0) 推荐(0) 编辑
摘要: client.py import os import sys import json import struct import socket # 下载--接收文件 def download(sk): # 下载 opt_dic = {'operate':'download'} my_send(sk,o 阅读全文
posted @ 2020-06-02 22:19 collin_pxy 阅读(87) 评论(0) 推荐(0) 编辑
摘要: import hashlib def get_md5(username,password): md5 = hashlib.md5(username.encode('utf-8')) # 加盐 md5.update(password.encode('utf-8')) return md5.hexdig 阅读全文
posted @ 2020-06-02 22:16 collin_pxy 阅读(87) 评论(0) 推荐(0) 编辑
摘要: import re from functools import reduce # 定义一个只计算两个数的乘法或除法的函数: def multiply_division(exp): if "*" in exp: # first=exp.split("*")[0] # second=exp.split( 阅读全文
posted @ 2020-06-02 22:15 collin_pxy 阅读(95) 评论(0) 推荐(0) 编辑
摘要: import sys import pickle import os USERINFO = r'C:\Users\12078\PycharmProjects\OldBoy\选课系统\userinfo' STUINFO = r'C:\Users\12078\PycharmProjects\OldBoy 阅读全文
posted @ 2020-06-02 22:13 collin_pxy 阅读(197) 评论(0) 推荐(0) 编辑