Lv.1
在 why!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 中回复
实现可以是标志位, 保存用base64+二进制了解一下
2020-08-20T15:02:33 点赞:0
在 救救救救救 中回复
异步的核心在于事件,也就是说如果有堵塞的IO操作 (比如说 网络请求、文件读写、数据库访问)就不等待,但是好像scratch里没有IO操作吧?
2020-08-20T15:06:42 点赞:0
在 【Python作品分享】编程猫第三方接口制作中!【作品秀】 中回复
一个失败的例子:https://shequ.codemao.cn/wiki/forum/331220
2020-08-20T19:43:39 点赞:0
在 找师傅.. 中回复
操作数据库
会MySQL
GUI界面编程
会tkinter
pygame编程
不太会
网络爬虫开发
比较熟悉requests和beautifulsoup4
使用进程和线程
并发编程我在行
网络编程
读过HTTP规范
web开发
会H喵L+CSS+JavaScript
flask框架
我主要就是用这个
2020-08-22T23:25:10 点赞:0
在 为什么在绘制图像时输入import matplotlib.pyplot as plt找不到指定的模块 中回复
命令行运行 pip install matplotlib
2020-08-23T20:13:00 点赞:0
在 【Python精讲】如何使用自定义模块(说人话就是在一个py文件中运行另一个py文件) 中回复
创建模块时,模块名不能为Python自带的标准库名称
不赞同,因为如果有同名模块则按搜索路径导入 (默认为当前目录优先), 这个列表是sys.path
2020-08-28T11:53:04 点赞:0
在 【C Sharp教程】【1】输出Hello World 中回复
C语言多简洁:
#include <stdio.h>
int main() {
printf("hello, world");
}
2020-08-29T16:16:07 点赞:0
在 300多行代码的作品 中回复
写出两千多行的我不服:
github.com/17097231932/graphical/blob/master/graphical.py
2020-08-29T16:34:25 点赞:0
在 【Python作品分享】欢迎来到PY的世界【作品秀】 中回复
百分百是积木拼的:
1、海龟实例化用的变量名是 __Pen
2、#开始进入Python的世界
2020-08-29T16:41:20 点赞:0
在 【C Sharp教程】【2】变量与常量 中回复
string value = "hello";
要用:
char* value = "hello";
或:
char value[] = "hello";2020-08-29T16:47:42 点赞:0
在 【Python作品分享】mc指令库【教程贴】 中回复
import tkinter as __gui_tk
from tkinter import ttk as __gui_ttk
from tkinter.messagebox import showinfo as __gui_showstring_orig
# 实现函数
def __gui_showstring(*values, title='', sep='', end='', file=None, flush=False):
output = sep.join(values) + end
if file == None:
__gui_showstring_orig(title, output)
else:
file.write(output)
if flush:
file.flush()
def __gui_askstring(title, prompt, initialvalue=None, parent=None):
def cancel(event=None):
nonlocal result
result = initialvalue
top.destroy()
def ok(event=None):
value = entry.get()
if value == '':
value = initialvalue
nonlocal result
result = value
top.destroy()
result = None
top = __gui_tk.Toplevel(parent)
top.title(title)
screen_width = top.winfo_screenwidth()
screen_height = top.winfo_screenheight()
top.geometry('+%d+%d' % ((screen_width) / 2 - 110,(screen_height) / 2 - 50))
__gui_ttk.Label(top, text=prompt, font=(None, 13)).grid(column=0, row=0, padx=3, pady=3)
entry = __gui_ttk.Entry(top, show=None)
entry.grid(column=0, row=1, padx=10, columnspan=3)
entry.focus()
btn1 = __gui_ttk.Button(top, text='取消', command=cancel, default='active')
btn2 = __gui_ttk.Button(top, text='确定', command=ok)
btn1.grid(column=0, row=2, padx=10)
btn2.grid(column=2, row=2, padx=10)
top.protocol("WM_DELETE_WINDOW", cancel)
top.bind("<Return>", ok)
top.bind("<Escape>", cancel)
top.wait_window(top)
return result
# 常量定义
GUI_TITLE = '提示'
GUI_PROMPT = '请输入:'
GUI_WINDOW = __gui_tk.Tk()
GUI_WINDOW.withdraw()
# 以下是用户实现
__gui_showstring('欢迎来到mc指令编辑库,输入效果自动弹出mc指令', title=GUI_TITLE)
__gui_showstring('由烈然lr工作室出品', '如果发现错误,请加烈然战队xiaomo或狱然yuran好友,只支持中国版', title=GUI_TITLE)
__gui_showstring('本作品正在更新...', title=GUI_TITLE)
__gui_showstring('<>或[]之内可自己填写', title=GUI_TITLE)
__gui_showstring('#号后是意思', title=GUI_TITLE)
__gui_showstring('效果大全', title=GUI_TITLE)
__gui_showstring('跳跃增强', title=GUI_TITLE)
__gui_showstring('荆棘+保护胸甲', title=GUI_TITLE)
__gui_showstring('锋利钻石剑', title=GUI_TITLE)
__gui_showstring('增加经验值', title=GUI_TITLE)
__gui_showstring('获得命令方块', title=GUI_TITLE)
__gui_showstring('新手版', title=GUI_TITLE)
__gui_showstring('玩家收到/不收到消息', title=GUI_TITLE)
open_ = __gui_askstring(prompt='', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
if (open_ == '荆棘+保护胸甲'):
__gui_showstring('/give @p diamond_chestplate 1 0 {Unbreakable:1b,e喵h:[{id:0,lvl:<强度(超过1000000作废)>},{id:7,lvl:<强度(超过1000000作废)>}]}', title=GUI_TITLE)
if (open_ == '锋利钻石剑'):
__gui_showstring('/give @a minecraft:diamond_sword 1 0 {e喵h:[{id:16,lvl:<强度(超过1000000作废)>}]}', title=GUI_TITLE)
if (open_ == '增加经验值'):
__gui_showstring('/xp <数量> <玩家名>', title=GUI_TITLE)
if (open_ == '获得命令方块'):
__gui_showstring('/give @p command_block', title=GUI_TITLE)
if (open_ == '玩家收到/不收到消息'):
__gui_showstring('/commandBlockOutput ', title=GUI_TITLE)
if (open_ == '新手版'):
__gui_showstring('欢迎打开新手版,以下是新手指令', title=GUI_TITLE)
__gui_showstring('传送', title=GUI_TITLE)
__gui_showstring('清除玩家物品', title=GUI_TITLE)
New_ = __gui_askstring(prompt='', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
if (New_ == '传送'):
__gui_showstring('/tp <玩家1> <玩家2>', '第二个括号可以填坐标', '#将XXX传送至XXX', title=GUI_TITLE)
if (New_ == '清除玩家物品'):
__gui_showstring('/clear [玩家] [数量] [物品名]', '可以直接输入/clear #直接清除所有物品', '可以不输[玩家]之后的 #如果输入[数量],就必须写[物品名]', title=GUI_TITLE)
if (open_ == '效果大全'):
__gui_showstring('欢迎来到效果大全', title=GUI_TITLE)
__gui_showstring('速度', title=GUI_TITLE)
__gui_showstring('缓慢', title=GUI_TITLE)
__gui_showstring('挖掘效率', title=GUI_TITLE)
Num_ = __gui_askstring(prompt='', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
if (Num_ == '速度'):
__gui_showstring('/effect Speed [效果强度(最高255)] [维持时间]', title=GUI_TITLE)
if (Num_ == '缓慢'):
__gui_showstring('/effect Slowness [效果强度(最高255)] [维持时间]', title=GUI_TITLE)
if (Num_ == '挖掘效率'):
__gui_showstring('/effect Haste [效果强度(最高255)] [维持时间]', title=GUI_TITLE)
改成GUI了,
预告:文字游戏GUI转换器即将推出……
2020-09-04T22:43:28 点赞:0
在 【Python作品分享】石头剪刀布jghjghjhgjhjgghjhgj【求助帖】 中回复
import tkinter as __gui_tk
from tkinter import ttk as __gui_ttk
from tkinter.messagebox import showinfo as __gui_showstring_orig
# 实现函数
def __gui_showstring(*values, title='', sep='', end='', file=None, flush=False):
output = sep.join(values) + end
if file == None:
__gui_showstring_orig(title, output)
else:
file.write(output)
if flush:
file.flush()
def __gui_askstring(title, prompt, initialvalue=None, parent=None):
def cancel(event=None):
nonlocal result
result = initialvalue
top.destroy()
def ok(event=None):
value = entry.get()
if value == '':
value = initialvalue
nonlocal result
result = value
top.destroy()
result = None
top = __gui_tk.Toplevel(parent)
top.title(title)
screen_width = top.winfo_screenwidth()
screen_height = top.winfo_screenheight()
top.geometry('+%d+%d' % ((screen_width) / 2 - 110,(screen_height) / 2 - 50))
__gui_ttk.Label(top, text=prompt, font=(None, 13)).grid(column=0, row=0, padx=3, pady=3)
entry = __gui_ttk.Entry(top, show=None)
entry.grid(column=0, row=1, padx=10, columnspan=3)
entry.focus()
btn1 = __gui_ttk.Button(top, text='取消', command=cancel, default='active')
btn2 = __gui_ttk.Button(top, text='确定', command=ok)
btn1.grid(column=0, row=2, padx=10)
btn2.grid(column=2, row=2, padx=10)
top.protocol("WM_DELETE_WINDOW", cancel)
top.bind("<Return>", ok)
top.bind("<Escape>", cancel)
top.wait_window(top)
return result
# 常量定义
GUI_TITLE = '提示'
GUI_PROMPT = '请输入:'
GUI_WINDOW = __gui_tk.Tk()
GUI_WINDOW.withdraw()
# 以下是用户实现
import random
# 石头剪刀布
choices = ['石头','布','剪刀']
__gui_showstring('Hi,训练师!我是编程猫!很高兴遇见你!现在我们来玩石头剪刀布的游戏吧!', title=GUI_TITLE)
__gui_showstring('石头剪刀布!', title=GUI_TITLE)
player = __gui_askstring(prompt='你要出石头呢,还是剪刀呢,还是布?(如输入“退出”,可退出游戏)', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
# 直到退出游戏之前,下面的循环都会继续
while (player != '退出'):
# 验证玩家和电脑各自的选择
computer = random.choice(choices)
__gui_showstring((((('你出了' + player) + ',电脑出了') + computer) + '...'), title=GUI_TITLE)
if (player == computer) :
__gui_showstring("平局!", title=GUI_TITLE)
elif (player == '石头') :
if computer == "剪刀":
__gui_showstring("你赢了!", title=GUI_TITLE)
else:
__gui_showstring("电脑赢了!", title=GUI_TITLE)
elif (player == '布') :
if computer == "石头":
__gui_showstring("你赢了", title=GUI_TITLE)
else:
__gui_showstring("电脑赢了!", title=GUI_TITLE)
elif (player == '剪刀') :
if computer == "布":
__gui_showstring("你赢了", title=GUI_TITLE)
else:
__gui_showstring("电脑赢了!", title=GUI_TITLE)
else :
__gui_showstring("出错了哦!只能出“石头”“剪刀”或“布”!", title=GUI_TITLE)
# 立即再来一轮,直到退出游戏
__gui_showstring('石头剪刀布!', title=GUI_TITLE)
player = __gui_askstring(prompt='你要出石头呢,还是剪刀呢,还是布?(如输入“退出”,可退出游戏)', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
GUI版石头剪刀布,
预告:即将推出文字作品GUI转换器……
2020-09-04T22:50:41 点赞:0
在 【Python作品分享】新的作品【作业帖】 中回复
GUI版:
# This is @generated code; do not edit!
import tkinter as __gui_tk
from tkinter import ttk as __gui_ttk
from tkinter.messagebox import showinfo as __gui_showstring_orig
# 实现函数
def __gui_showstring(*values, title='', parent=None, sep='', end='', file=None, flush=False):
output = sep.join(values) + end
if file == None:
__gui_showstring_orig(title, output, parent=parent)
else:
file.write(output)
if flush:
file.flush()
def __gui_askstring(title, prompt, initialvalue=None, parent=None):
def cancel(event=None):
nonlocal result
result = initialvalue
top.destroy()
def ok(event=None):
value = entry.get()
if value == '':
value = initialvalue
nonlocal result
result = value
top.destroy()
result = None
top = __gui_tk.Toplevel(parent)
top.title(title)
screen_width = top.winfo_screenwidth()
screen_height = top.winfo_screenheight()
top.geometry('+%d+%d' % ((screen_width) / 2 - 110,(screen_height) / 2 - 50))
__gui_ttk.Label(top, text=prompt, font=(None, 13)).grid(column=0, row=0, padx=3, pady=3)
entry = __gui_ttk.Entry(top, show=None)
entry.grid(column=0, row=1, padx=10, columnspan=3)
entry.focus()
btn1 = __gui_ttk.Button(top, text='取消', command=cancel, default='active')
btn2 = __gui_ttk.Button(top, text='确定', command=ok)
btn1.grid(column=0, row=2, padx=10)
btn2.grid(column=1, row=2, padx=10)
top.protocol("WM_DELETE_WINDOW", cancel)
top.bind("<Return>", ok)
top.bind("<Escape>", cancel)
top.wait_window(top)
return result
# 常量定义
GUI_TITLE = '提示' # 窗口标题
GUI_PROMPT = '请输入:' # 默认提示符
GUI_WINDOW = __gui_tk.Tk()
GUI_WINDOW.withdraw()
# 以下是代码逻辑实现
import time
#开始进入Python的世界
广播2 = 10
__gui_showstring('i am very happy!', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(0.5)
__gui_showstring('now i teach you about the game somthing...', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(0.5)
__gui_showstring('emmm...you are Chinese people?', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(0.5)
name = __gui_askstring(prompt='what is your name?', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
__gui_showstring('你好', name, title=GUI_TITLE, parent=GUI_WINDOW)
sr = __gui_askstring(prompt='我想考考你1+1+?', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
if (2 == sr):
__gui_showstring('不错', name, title=GUI_TITLE, parent=GUI_WINDOW)
else:
__gui_showstring('emmmm', name, title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
__gui_showstring('好吧也许是我高估了你', title=GUI_TITLE, parent=GUI_WINDOW)
__gui_showstring('你可以输入:1-我想聊聊天', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
__gui_showstring('你可以输入:2-我想重启', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
__gui_showstring('你可以输入:3-玩游戏', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
选择 = __gui_askstring(prompt='请选择', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
if (1 == 选择):
广播 = 1
广播2 = 1
elif (选择 == 2):
广播 = 2
广播2 = 1
elif (选择 == 3):
广播 = 3
广播2 = 1
else:
__gui_showstring('你以为我是瞎子吗?', title=GUI_TITLE, parent=GUI_WINDOW)
#开始进入Python的世界
if (广播2 != 0):
if (广播 == 1):
__gui_showstring('我觉得我俩没啥好谈的', title=GUI_TITLE, parent=GUI_WINDOW)
广播2 = 0
elif (广播 == 2):
__gui_showstring('我办不到', title=GUI_TITLE, parent=GUI_WINDOW)
广播2 = 0
elif (广播 == 3):
__gui_showstring('??????', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
__gui_showstring('我数学也不好!', title=GUI_TITLE, parent=GUI_WINDOW)
广播2 = 0
else:
pass
else:
pass
#开始进入Python的世界
if (广播2 == 0):
__gui_showstring('你可以输入:1-我想聊聊天', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
__gui_showstring('你可以输入:2-我想重启', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
__gui_showstring('你可以输入:3-玩游戏', title=GUI_TITLE, parent=GUI_WINDOW)
time.sleep(1)
选择 = __gui_askstring(prompt='请选择', title=GUI_TITLE, parent=GUI_WINDOW, initialvalue='')
if (选择 == 1):
广播 = 1
广播2 = 1
elif (选择 == 2):
广播 = 2
广播2 = 1
elif (选择 == 3):
广播 = 3
广播2 = 1
else:
__gui_showstring('你以为我是瞎子吗?', title=GUI_TITLE, parent=GUI_WINDOW)
else:
pass
用的 https://shequ.codemao.cn/community/340191
2020-09-05T19:54:30 点赞:0