上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 37 下一页
摘要: 解决黏包的问题 struct 模块 https://blog.csdn.net/weixin_33812391/article/details/111905211 # server import json import struct import socket sk = socket.socket( 阅读全文
posted @ 2021-08-28 10:04 该显示昵称已被使用了 阅读(17) 评论(0) 推荐(0) 编辑
摘要: python # python 天生支持多态 class Alipay(): def pay(self,money): print('已经用支付宝支付了%s元' % money) class Applepay(): def pay(self,money): print('已经用applepay支付了 阅读全文
posted @ 2021-08-28 08:09 该显示昵称已被使用了 阅读(16) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/Eva-J/articles/7293890.html java # java里的所有类的继承都是单继承,所以抽象类完美的解决了单继承需求中的规范问题 # 但对于多继承的需求,由于java本身语法的不支持,所以创建了接口Interface这个概念来解决 阅读全文
posted @ 2021-08-28 07:31 该显示昵称已被使用了 阅读(57) 评论(0) 推荐(0) 编辑
摘要: Python对协程的支持是通过generator实现的 # 生产者send # 消费者yield 【yield不但可以返回一个值,它还可以接收调用者发出的参数】 def consumer(): r = '' while True: n = yield r if not n: return print 阅读全文
posted @ 2021-08-27 15:42 该显示昵称已被使用了 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 利用【queue】【BaseManager】 # master #!/usr/bin/env python3 # -*- coding: utf-8 -*- import queue from multiprocessing.managers import BaseManager # 发送任务的队列 阅读全文
posted @ 2021-08-25 15:03 该显示昵称已被使用了 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 算法中容易遇到的坑 # [2:2]前后相等,什么都获取不到的 list_t = [1,2,3,4,5] print(list_t[2:2]) # [] 阅读全文
posted @ 2021-08-20 10:30 该显示昵称已被使用了 阅读(43) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/qq_52480014/article/details/114264635 import tkinter as tk # Python 3 import # import Tkinter as tk # Python 2 import root = tk. 阅读全文
posted @ 2021-08-17 22:15 该显示昵称已被使用了 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 根据node个数,选出数字中node个数的数据进行验证 import time from multiprocessing import Process import os from multiprocessing import Pool import os, time, random # 多线程二分 阅读全文
posted @ 2021-08-17 15:45 该显示昵称已被使用了 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 思路1,master等待远端返回结果 from multiprocessing import Pool import os, time, random # 在远端执行的任务进程,,hang住等待返回 def long_time_task(ip,url): print('Run task %s-%s 阅读全文
posted @ 2021-08-17 15:25 该显示昵称已被使用了 阅读(35) 评论(0) 推荐(0) 编辑
摘要: https://www.liaoxuefeng.com/wiki/1016959663602400/1017628290184064 join # 1. 一个 from multiprocessing import Process import os # 子进程要执行的代码 def run_proc 阅读全文
posted @ 2021-08-17 10:28 该显示昵称已被使用了 阅读(205) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 37 下一页