上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 30 下一页
摘要: 1.UDP,我这里暂时没写代码,懒得写了, 2.TCP: 2.1TCP服务端 import socket from multiprocessing import Process # 开两个进程,然后一个接收,一个发送 def receive(con): while True: recv_cmd = 阅读全文
posted @ 2021-07-09 13:20 3ξ 阅读(46) 评论(0) 推荐(0) 编辑
摘要: import datetime,logging import asyncio from pyppeteer import launch from lxml import etree async def getMvPlays(url): browser = await launch({'handleS 阅读全文
posted @ 2021-07-06 18:53 3ξ 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 1.先上功能,直接自动化发消息 我们首先需要定位窗口坐标, import pyautogui as pg print(pg.position()) import pyautogui as pg import pyperclip import time time.sleep(5) msg = "aaa 阅读全文
posted @ 2021-07-06 08:39 3ξ 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 1.1迭代器: 首先可迭代对象=字符串 列表 元组对象变成迭代器iter(列表)然后迭代器,具有两个属性__iter__() 与 __next__() # arr = [1,2,3]# print(next(iter(arr)))# 如果遍历完了还继续next 就会出现StopIteration异常 阅读全文
posted @ 2021-07-01 11:03 3ξ 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 装饰器 = 高阶函数 + 闭包 1.什么是闭包; # 闭包:就是不执行,等待调用状态 def fun(): print("执行函数") f = fun print(type(f),f) # <class 'function'> <function fun at 0x000002139B203438> 阅读全文
posted @ 2021-06-30 16:19 3ξ 阅读(30) 评论(0) 推荐(0) 编辑
摘要: # print(globals())#全局变量 # print(locals())#局部变量 arr = dir(__builtins__)#这个可以看内置的方法哦 for i in range(len(arr)): print(f"{i} {arr[i]}") 下面的是具体有哪些内置方法:等我有空 阅读全文
posted @ 2021-06-30 15:52 3ξ 阅读(44) 评论(0) 推荐(0) 编辑
摘要: ''' filter :过滤掉一些东西 map :无特殊 reduce:一次性执行两个参数:让数组【1,2,3】变成123 ''' # print(list(filter(lambda x:True if x>3 else False,range(10)))) # print(list(map(la 阅读全文
posted @ 2021-06-30 15:35 3ξ 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 1.字符串 》datetime dd = '2019-03-17 11:00:00' dd = datetime.datetime.strptime(dd, "%Y-%m-%d %H:%M:%S") 2.datetime >字符串 dc = dd.strftime("%Y-%m-%d %H:%M:% 阅读全文
posted @ 2021-06-30 15:03 3ξ 阅读(88) 评论(0) 推荐(0) 编辑
摘要: import random # 随机数 print(random.randrange(1,2)) # 返回值从列表里拿一个字符 print(random.choice([1,2,3])) # 返回值,从列表里拿N个数据,放在列表里 print(random.sample([1,2,3],2)) # 阅读全文
posted @ 2021-06-30 14:52 3ξ 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd() 返回指定目录下的所有文件和目录名:os.listdir() 函数用来删除一个文件:os.remove() 删除多个目录:os.removedirs(r“c:\python”) 检验给出的路径是否是一个文件:os.pat 阅读全文
posted @ 2021-06-30 14:34 3ξ 阅读(43) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 30 下一页