Python3 4
-
06 2021年06月
-
04 2021年04月
Python3 杂记
ifif 实现三元运算例:a = 1b = 2c = b if a>b else aprint(c)结果为: 1whilewhile int:如k = 1while k: <循环体>当 k!=0 时,将会不断循环。一行挨打while True: passlistlist 实现
-
10 2021年02月
使用 Python 获取 Minecraft Bedrock 服务器信息
某天看到部分群中的机器人支持 获取MCBE服务器的基础信息,便想自行撸一个。通过抓包发现这一过程通过 UDP 实现。实现代码: import sysimport socketaddress = "" #服务器地址port = 19132 #服务器端口client = socket.socket(so
-
30 2020年12月
石头剪刀布 —— 从强行判断到巧妙处理
前言这一开始仅为一个简单题目,使用 random.choice 实现石头剪刀布的出招,无需判断,就像下面这样:from random import choicegList = ['石头','剪刀','布']for _ in range(10): print(choice(gList),