
Lv.1
Hi, I'm Fexcode, a member of Xnors Studio(异或工作室)
在 python空白知识点求普及!! 中回复
pgzrun没有设置背景的,可以用以下方法:
import pyzero #我也才学,可能有错,请多多包容。
变量名 = Actor ("图片.png") #第一个设置,这样才可以有背景的效果(在最下层)。
def draw ( ) : #函数名不能变
变量名.draw( )
pgzrun.go( ) #开始,末尾必须有。
2022-12-27T14:57:07 点赞:0
在 招跑酷引擎制作者 中回复
https://kitten4.codemao.cn/?invite_code=DGIYE8喵:DGIYE8我在编程猫发起了一个协作项目,点击链接即可加入一起创作!
2022-12-30T10:11:05 点赞:0
在 免费做UI了! 中回复
我这边就差一个UI师了,能帮帮我吗!!! qq:27346喵632 https://kitten4.codemao.cn/?invite_code=17RWEW邀、请、码:17RWEW
2023-01-03T12:52:39 点赞:0
在 Python教程4(1)——变量,暂时的银行 中回复
a,b = input('a= '),input('b= ')
a,b = b,a
#额3个变量...,五行代码...。。。以下是无用代码...
print(a,b)
c = int(a)+int(b) print(c)
2023-01-12T12:32:43 点赞:0
在 【Python作品分享】main【求助帖】 中回复
from arcade import*
from arcade import color
open_window(600, 400, 'rainbow')
set_background_color(color.WHITE)
start_render()
draw_circle_filled(300, 0, 300, color.RED)
draw_circle_filled(300, 0, 290, color.YELLOW)
draw_circle_filled(300, 0, 290, color.GREEN)
draw_circle_filled(300, 0, 290, color.BLUE)
draw_circle_filled(300, 0, 290, color.PURPLE)
draw_circle_filled(300, 0, 290, color.WHITE)
finish_render()
run()#嘿嘿嘿2023-01-14T18:56:30 点赞:0
在 python教程print函数(第2次发,上次有错误) 中回复
编程猫社区-python教程2——input,让用户自己控制程序-编程学习交流 (codemao.cn)
刚出炉的帖子↑
2023-01-18T20:04:44 点赞:0
在 python教程2——input,让用户自己控制程序 中回复
还是没有人
https://shequ.codemao.cn/community/520307
新鲜的帖子估计也没人看了。
2023-01-19T13:39:39 点赞:0
在 python教程3——变量和数据类型 中回复
class rect:
a: int
b: int
def __init__(self, a: int, b: int):
self.a = a
self.b = b
def area(self):
return (self.a*self.b)
def length(self):
return (self.a+self.b)*2
r = rect(float(input('长:')), float(input('宽:')))
print(f'长={r.a} 宽={r.b} 面积={r.area()} 周长={r.length()}')
这样就可以算小数了。
try:
class rect:
a: int
b: int
def __init__(self, a: int, b: int):
self.a = a
self.b = b
def area(self):
return (self.a*self.b)
def length(self):
return (self.a+self.b)*2
r = rect(float(input('长:')), float(input('宽:')))
print(f'长={r.a} 宽={r.b} 面积={r.area()} 周长={r.length()}')
except ValueError:
print('墓前不支持文字')
这样...
import easygui as eg
chang = eg.enterbox('长:')
kuan = eg.enterbox('宽')
try:
class rect:
a: int
b: int
def __init__(self, a: int, b: int):
self.a = a
self.b = b
def area(self):
return (self.a*self.b)
def length(self):
return (self.a+self.b)*2
r = rect(float(chang), float(kuan))
eg.msgbox(f'长={r.a} 宽={r.b} 面积={r.area()} 周长={r.length()}')
except ValueError:
eg.msgbox('墓前不支持文字')
这样更好
import easygui as eg
while True:
try:
chang = float(eg.enterbox('长:'))
kuan = float(eg.enterbox('宽'))
if kuan > chang:
eg.msgbox('长知识了,宽原来比长大')
raise EOFError
class rect:
a: int
b: int
def __init__(self, a: int, b: int):
self.a = a
self.b = b
def area(self):
return (self.a*self.b)
def length(self):
return (self.a+self.b)*2
r = rect(float(chang), float(kuan))
eg.msgbox(f'长={r.a} 宽={r.b} 面积={r.area()} 周长={r.length()}')
except ValueError:
eg.msgbox('墓前不支持文字')
except EOFError:
answer = eg.buttonbox('重来?', choices=('好吧'))
if answer == '好吧':
eg.msgbox('OK')
else:
eg.buttonbox('好吧')
break2023-01-19T16:11:06 点赞:0
在 Python教程5——数据转化代码,老孙可以七十二变! 中回复
作者从来没有看过我的作业...
这次我花了1小时编码和调试。
看看吧
排除一切可能的风险:
BB = [ # ctrl_C_V
">>> 输入头的数量",
">>> 输入脚的数量",
">>> 鸡的数量",
">>> 兔的数量",
]
def answer(h, f) -> tuple:
ji = 0
tu = h
count = 0
while not (ji * 2 + tu * 4 == f):
ji += 1
tu -= 1
count += 1
if count >= h*12:
print("程序计算失败")
break
if tu < 0 or ji < 0:
print("程序计算失败")
else:
return ji, tu
return "不知道","不知道"
while 1:
try:
try:
tou = int(input(BB[0]))
jiao = int(input(BB[1]))
if tou*4 < jiao:
raise ValueError(">>> 额...题目错了")
else:
if tou > jiao:
raise ValueError(">>> 额...题目错了")
else:
raise ji
except ValueError as s_binput:
print(">>> ValueError:", s_binput)
continue
except ji:
ansl = list(answer(tou, jiao))
print(BB[2], ansl[0])
print(BB[3], ansl[1])
except NameError:
continue
finally:
ansl = list(answer(tou, jiao))
print(BB[2], ansl[0])
print(BB[3], ansl[1])
2023-02-05T17:30:12 点赞:2