猫史档案馆


沉著的飞叶龙uZWJ

沉著的飞叶龙uZWJ

Lv.1

获赞:6收藏:0浏览:18作品收藏:0
回复帖子评论
上一页3 页 / 共 4下一页

【计算器消息】计算器1.12作品发布有些问题,一直卡着 中回复

现在问题还没有解决,如果解决不了就不发布了

2020-04-30T22:24:40 点赞:0

【计算器消息】计算器1.12作品发布有些问题,一直卡着 中回复

今天还没有,可能就不发布了

2020-05-01T09:34:19 点赞:0

【睡觉去消息】 中回复

发布了几个小时才发现题目打错了,是“”计算器消息“”😓

2020-05-01T16:40:02 点赞:0

【Python作品分享】cps测试【作品秀】 中回复

顶 

2020-05-04T20:22:49 点赞:0

【Python作品分享】2019CoronaVirus散点传播实验(覆盖优化版)【作品秀】 中回复

import math import turtle import random#准备 people_1 = False people_2 = True people_3 = True people_4 = True people_5 = True people_6 = True people_7 = True people_8 = True people_9 = True people_10 = True people_11 = True people_12 = True people_13 = True people_14 = True people_15 = True people_16 = True people_17 = True people_18 = True people_19 = True people_20 = True people_21 = True people_22 = True people_23 = True people_24 = True people_25 = True people_26 = True people_27 = True people_28 = True people_29 = True people_30 = True people_31 = True people_32 = True people_33 = True people_34 = True people_35 = True people_36 = True people_37 = True #每个人的初始健康状态
def distance(x1, y1, x2, y2):
return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) #↑两点间的距离公式 #↓对列表中感染者、幸存者的数量检测 def check(List): infect=0 alive=0 for i in List: if i: alive+=1 else: infect+=1 return alive,infect s = turtle.Screen() s.setup(700,700)#设置屏幕的大小 people1 = turtle.Pen() people2 = turtle.Pen() people3 = turtle.Pen() people4 = turtle.Pen() people5 = turtle.Pen() people6 = turtle.Pen() people7 = turtle.Pen() people8 = turtle.Pen() people9 = turtle.Pen() people10 = turtle.Pen() people11 = turtle.Pen() people12 = turtle.Pen() people13 = turtle.Pen() people14 = turtle.Pen() people15 = turtle.Pen() people16 = turtle.Pen() people17 = turtle.Pen() people18 = turtle.Pen() people19 = turtle.Pen() people20 = turtle.Pen() people21 = turtle.Pen() people22 = turtle.Pen() people23 = turtle.Pen() people24 = turtle.Pen() people25 = turtle.Pen() people26 = turtle.Pen() people27 = turtle.Pen() people28 = turtle.Pen() people29 = turtle.Pen() people30 = turtle.Pen() people31 = turtle.Pen() people32 = turtle.Pen() people33 = turtle.Pen() people34 = turtle.Pen() people35 = turtle.Pen() people36 = turtle.Pen() people37 = turtle.Pen()#37个人类 people1.penup() people2.penup() people3.penup() people4.penup() people5.penup() people6.penup() people7.penup() people8.penup() people9.penup() people10.penup() people11.penup() people12.penup() people13.penup() people14.penup() people15.penup() people16.penup() people17.penup() people18.penup() people19.penup() people20.penup() people21.penup() people22.penup() people23.penup() people24.penup() people25.penup() people26.penup() people27.penup() people28.penup() people29.penup() people30.penup() people31.penup() people32.penup() people33.penup() people34.penup() people35.penup() people36.penup() people37.penup()#让移动不留痕迹 people1.speed(0) people2.speed(0) people3.speed(0) people4.speed(0) people5.speed(0) people6.speed(0) people7.speed(0) people8.speed(0) people9.speed(0) people10.speed(0) people11.speed(0) people12.speed(0) people13.speed(0) people14.speed(0) people15.speed(0) people16.speed(0) people17.speed(0) people18.speed(0) people19.speed(0) people20.speed(0) people21.speed(0) people22.speed(0) people23.speed(0) people24.speed(0) people25.speed(0) people26.speed(0) people27.speed(0) people28.speed(0) people29.speed(0) people30.speed(0) people31.speed(0) people32.speed(0) people33.speed(0) people34.speed(0) people35.speed(0) people36.speed(0) people37.speed(0)#加速实验 people1.color('red', 'red') people2.color('blue', 'blue') people3.color('blue', 'blue') people4.color('blue', 'blue') people5.color('blue', 'blue') people6.color('blue', 'blue') people7.color('blue', 'blue') people8.color('blue', 'blue') people9.color('blue', 'blue') people10.color('blue', 'blue') people11.color('blue', 'blue') people12.color('blue', 'blue') people13.color('blue', 'blue') people14.color('blue', 'blue') people15.color('blue', 'blue') people16.color('blue', 'blue') people17.color('blue', 'blue') people18.color('blue', 'blue') people19.color('blue', 'blue') people20.color('blue', 'blue') people21.color('blue', 'blue') people22.color('blue', 'blue') people23.color('blue', 'blue') people24.color('blue', 'blue') people25.color('blue', 'blue') people26.color('blue', 'blue') people27.color('blue', 'blue') people28.color('blue', 'blue') people29.color('blue', 'blue') people30.color('blue', 'blue') people31.color('blue', 'blue') people32.color('blue', 'blue') people33.color('blue', 'blue') people34.color('blue', 'blue') people35.color('blue', 'blue') people36.color('blue', 'blue') people37.color('blue', 'blue')#初始颜色,people1是初始感染者,为红色;其余为蓝色 all_pen = [people1, people2, people3, people4, people5, people6, people7, people8, people9, people10, people11, people12, people13, people14, people15, people16, people17, people18, people19, people20, people21, people22, people23, people24, people25, people26, people27, people28, people29, people30, people31, people32, people33, people34, people35, people36, people37] people_health = [people_1, people_2, people_3, people_4, people_5, people_6, people_7, people_8, people_9, people_10, people_11, people_12, people_13, people_14, people_15, people_16, people_17, people_18, people_19, people_20, people_21, people_22, people_23, people_24, people_25, people_26, people_27, people_28, people_29, people_30, people_31, people_32, people_33, people_34, people_35, people_36, people_37] #将每个人及他们的健康状态存入列表 hospital = int(input('输入初始医疗资源数量')) hospital_reaction_time = int(input('输入医院反应时间')) people_speed = int(input('输入人口流动速度')) jishi = 1 infect_distance = int(input('输入最大传染距离')) cure_speed = int(input('输入一天治疗几名患者')) shengchanlv = int(input('输入医疗资源生产效率(几天一个)'))#输入参数 for i in all_pen: i.goto(random.uniform(-350, 350), random.uniform(-350,350))#初始位置  

2020-05-07T21:08:12 点赞:0

【Python作品分享】2019CoronaVirus散点传播实验(覆盖优化版)【作品秀】 中回复

while True:
for i in all_pen:
i.setheading(random.uniform(0, 360))
i.forward(people_speed)#所有人移动
for i in all_pen:
if(i.xcor() > 350):
i.setx(350)
if(i.ycor() > 350):
i.sety(350)
if(i.xcor() < -350):
i.setx(-350)
if(i.ycor() < -350):
i.sety(-350)#将出界者拉回屏幕
for i inrange(len(all_pen)):
for j inrange(len(all_pen)):
if(distance(all_pen[i].xcor(), all_pen[i].ycor(), all_pen[j].xcor(), all_pen[j].ycor()) <= infect_distance)and(not people_health[i]ornot people_health[j]):
all_pen[i].color('red', 'red')
all_pen[j].color('red', 'red')
people_health[i] = False
people_health[j] = False#用穷举法对所有感染情况进行判断,更新感染者和被感染者的颜色
if jishi==hospital_reaction_time + 1:
print('医院已开始工作!')#医院反应后开始工作
if jishi > hospital_reaction_time:
for i inrange(cure_speed):
for j in people_health:
if hospital <= 0:
continue#医疗资源用完时无法工作
ifnot j:
people_health[people_health.index(j)]=True
hospital-=1
break#每天治疗 cure_speed 名感染者
for i inrange(len(all_pen)):
if people_health[i]:
all_pen[i].color('blue','blue')#更新治愈者的颜色
print('Day',jishi)
print('医疗资源还够',hospital,'人使用')
a,b=check(people_health)
print('幸存者有',a,'位','感染者有',b,'位')
print('幸存者占比为',str(round(a/37*100,3))+'%','感染者占比为',str(round(b/37*100,3))+'%')#数据报告
if a==0:
print('人类已被全部感染!')# 结果报告
break
if b==0:
print('人类已被全部治愈!')# 结果报告
break
jishi+=1#记录循环次数的变量值+1
if jishi%shengchanlv==0:
hospital+=1#每几天生产出一人份的医疗物资

2020-05-07T21:09:09 点赞:0

【Python作品分享】2019CoronaVirus散点传播实验(覆盖优化版)【作品秀】 中回复

https://shequ.cod喵/community/261580

2020-05-07T21:53:49 点赞:0

【Python作品分享】不是作业 中回复

水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水

2020-05-08T19:07:12 点赞:0

Hi~ o(* ̄▽ ̄*)ブ,大家晚上好,大家还记得我吗,记得的扣1,有印象的的扣2,不认识是扣3。 中回复

2020-05-10T00:01:18 点赞:0

【Python作品分享】新的作品【求助帖】 中回复

水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水

2020-05-11T17:25:51 点赞:0

【Python作品分享】食神谱【作品秀】 中回复

emotion_编程猫_点赞

2020-05-11T20:44:08 点赞:0

【Python作品分享】计算器【作品秀】 中回复

<pre class="language-python"><code>

import math import tkinter import easygui#准备 calculator=tkinter.Tk()#创建窗口 calculator.geometry('400x400')#设置大小 calculator.resizable(0,0)#不许拉动 calculator.title('计算器')#设置标题 content=tkinter.StringVar() LEDboard=tkinter.Label(calculator,textvariable=content,bg='#efefef',width=50,height=1)#假装是LED板 LEDboard.place(x=20,y=100)#放置LED板 def one(): if"="in content.get(): content.set('1') else: content.set(content.get()+'1') b1 = tkinter.Button(calculator,text='1',bg='white',width=5,height=2,command=one) b1.place(x=100,y=200)

def two(): if"="in content.get(): content.set('2') else: content.set(content.get()+'2')

b2 = tkinter.Button(calculator, text='2', bg='white', width=5, height=2, command=two) b2.place(x=150, y=200)

def three(): if"="in content.get(): content.set('3') else: content.set(content.get()+'3')

b3 = tkinter.Button(calculator, text='3', bg='white', width=5, height=2, command=three) b3.place(x=200, y=200)

def four(): if"="in content.get(): content.set('1') else: content.set(content.get()+'4')

b4 = tkinter.Button(calculator, text='4', bg='white', width=5, height=2, command=four) b4.place(x=100, y=250)

def five(): if"="in content.get(): content.set('5') else: content.set(content.get()+'5')

b5 = tkinter.Button(calculator, text='5', bg='white', width=5, height=2, command=five) b5.place(x=150, y=250)

def six(): if"="in content.get(): content.set('6') else: content.set(content.get()+'6')

b6 = tkinter.Button(calculator, text='6', bg='white', width=5, height=2, command=six) b6.place(x=200, y=250)

def seven(): if"="in content.get(): content.set('1') else: content.set(content.get()+'8')

b7 = tkinter.Button(calculator, text='7', bg='white', width=5, height=2, command=seven) b7.place(x=100, y=300)

def eight(): if"="in content.get(): content.set('8') else: content.set(content.get()+'8')

b8 = tkinter.Button(calculator, text='8', bg='white', width=5, height=2, command=eight) b8.place(x=150, y=300)

def nine(): if"="in content.get(): content.set('9') else: content.set(content.get()+'9')

b9 = tkinter.Button(calculator, text='9', bg='white', width=5, height=2, command=nine) b9.place(x=200, y=300) def zero(): if"="in content.get(): content.set('9') else: content.set(content.get()+'0')

b0 = tkinter.Button(calculator, text='0', bg='white', width=5, height=2, command=zero) b0.place(x=100, y=350)

def dot(): if"="in content.get(): content.set('.') else: content.set(content.get()+'.')

dian = tkinter.Button(calculator, text='.', bg='white', width=5, height=2, command=dot) dian.place(x=150, y=350)
''' 10个数字和点,按钮大小和位置是作者亲测的,请勿修改哦~ ''' def add(): if"="in content.get(): content.set('+') else: content.set(content.get()+'+')

plus = tkinter.Button(calculator, text='+', bg='white', width=5, height=2,command=add) plus.place(x=250,y=200) # https://www.bilibili.com/video/BV1wJ411J7JK/?spm_id_from=333.788.videocard.28
def subtract(): if"="in content.get(): content.set('-') else: content.set(content.get()+'-')

minus= tkinter.Button(calculator, text='-', bg='white', width=5, height=2, command=subtract) minus.place(x=250, y=250) def multiple(): if"="in content.get(): content.set('×') else: content.set(content.get()+'×')

times= tkinter.Button(calculator, text='×', bg='white', width=5, height=2, command=multiple) times.place(x=300, y=250)
def divide(): if"="in content.get(): content.set('÷') else: content.set(content.get()+'÷') chu= tkinter.Button(calculator, text='÷', bg='white', width=5, height=2, command=divide) chu.place(x=250, y=350) #四则运算

2020-05-18T22:41:04 点赞:0

【Python作品分享】计算器【作品秀】 中回复

<pre class="language-python"><code> def equal():

 

content.set(content.get()+'=') try: value=content.get( )+str(eval(content.get().replace("factorial",'math.factorial').replace('×','*').replace('÷','/') .replace('sqrt','math.sqrt').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan') .replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos') .replace("atan",'math.atan').replace('=',''))) if'.'==str(value)[-2]and'0'==str(value)[-1]: content.set(str(value).split('.0')[0]) else: content.set(value) except ZeroDivisionError: easygui.msgbox('不能除以零!') content.set('') except: easygui.msgbox('输入有误!') content.set('')



dengyu = tkinter.Button(calculator, text='=', bg='white', width=5, height=2, command=equal) dengyu.place(x=200, y=350) #等于号

 

def chengfang(): if"="in content.get(): content.set('^') else: content.set(content.get()+'^') mi= tkinter.Button(calculator, text='^', bg='white', width=5, height=2, command=chengfang)#乘方运算 mi.place(x=300, y=200) def zuokuohao(): if"="in content.get(): content.set('(') else: content.set(content.get()+'(') leftkuohao= tkinter.Button(calculator, text='(', bg='white', width=5, height=2, command=zuokuohao) leftkuohao.place(x=250,y=300) def youkuohao(): if"="in content.get(): content.set(')') else: content.set(content.get()+')') rightkuohao= tkinter.Button(calculator, text=')', bg='white', width=5, height=2, command=youkuohao) rightkuohao.place(x=300,y=300) #两个括号 def backspace(): if"="in content.get(): content.set('') else: content.set(''.join(list(content.get()[0:len(content.get())-1]))) huishan=tkinter.Button(calculator, text=chr(9003), bg='white', width=5, height=2, command=backspace)#回删 huishan.place(x=300,y=350) def pai(): if"="in content.get(): content.set('π') else: content.set(content.get()+'π') yuanzhoulv=tkinter.Button(calculator, text='π', bg='white', width=5, height=2, command=pai)#圆周率 yuanzhoulv.place(x=50,y=200) def e(): if"="in content.get(): content.set('e') else: content.set(content.get()+'e') # e E=tkinter.Button(calculator, text='e', bg='white', width=5, height=2, command=e) E.place(x=50,y=250) # https://www.bilibili.com/video/BV1qx411R7TA/?spm_id_from=333.788.videocard.0



def all_clear():

 

content.set('') C=tkinter.Button(calculator,text='C',bg='white',width=5,height=2,command=all_clear) C.place(x=0,y=200)#全部清空



def sqr():

 

try: content.set((str(eval(str(content.get()).replace('factorial','math.factorial').replace('×', '*').replace('÷', '/').replace('sqrt', 'math.sqrt').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan') .replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos') .replace("atan",'math.atan'))**2))) except OverflowError: easygui.msgbox('太大了!!!') content.set('') except: easygui.msgbox('输入有误!')



pingfang = tkinter.Button( calculator, text='x²', bg='white', width=5, height=2, command=sqr) pingfang.place(x=50, y=350) # 快捷平方运算



def sqrt():

 

try: content.set('sqrt('+str(eval(str(content.get()).replace('factorial','math.factorial').replace('×', '*').replace('÷', '/').replace('sqrt','math.sqrt').replace('^', '**').replace('π',str(math.pi)) .replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))+")") except ValueError: easygui.msgbox('负数不能开平方根!') except: easygui.msgbox('输入有误!')



pingfanggen = tkinter.Button( calculator, text='√x', bg='white', width=5, height=2, command=sqrt) pingfanggen.place(x=50, y=300) # 快捷平方根运算 def factorial():

 

try: content.set(('factorial('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")") except ValueError: easygui.msgbox('只有整数能够阶乘!') except OverflowError: easygui.msgbox('太大了!!!') content.set('') except: easygui.msgbox('输入有误!')



jiecheng = tkinter.Button( calculator, text='x!', bg='white', width=5, height=2, command=factorial) jiecheng.place(x=0, y=250) # 快捷阶乘运算

 

2020-05-18T22:42:30 点赞:0

【Python作品分享】计算器【作品秀】 中回复

<pre class="language-python"><code>


def sin_hudu():
try: content.set(('sinr('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")") except: easygui.msgbox('输入有误!')

sinrad = tkinter.Button( calculator, text='sinr', bg='white', width=5, height=2, command=sin_hudu) sinrad.place(x=350,y=0)
def cos_hudu(): try: content.set(('cosr('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")") except: easygui.msgbox('输入有误!')

cosrad = tkinter.Button( calculator, text='cosr', bg='white', width=5, height=2, command=cos_hudu) cosrad.place(x=350,y=50) def tan_hudu(): try: content.set(('tanr('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")") except: easygui.msgbox('输入有误!')

tanrad = tkinter.Button( calculator, text='tanr', bg='white', width=5, height=2, command=tan_hudu) tanrad.place(x=350,y=100) """三角函数弧度运算""" def sin_jiaodu(): try: content.set(('sind('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos'). replace("atan",'math.atan')))))+"))") except:# 就是两个括号↑,其余同 easygui.msgbox('输入有误!')

sindeg = tkinter.Button( calculator, text='sind', bg='white', width=5, height=2, command=sin_jiaodu) sindeg.place(x=350,y=150) def cos_jiaodu(): try: content.set(('cosd('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan'))))+"))")) except: easygui.msgbox('输入有误!')

cosdeg = tkinter.Button( calculator, text='cosd', bg='white', width=5, height=2, command=cos_jiaodu) cosdeg.place(x=350,y=200)

def tan_jiaodu():
try: content.set(('tand('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+"))") except: easygui.msgbox('输入有误!')

tandeg = tkinter.Button( calculator, text='tand', bg='white', width=5, height=2, command=tan_jiaodu) tandeg.place(x=350,y=250) """三角函数角度运算""" def asin():
#try: content.set(('asin('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")") # except ValueError: # easygui.msgbox('asin只能填-1到1的数字!') # content.set('') # except: # easygui.msgbox('输入有误!')

arcsin = tkinter.Button( calculator, text='asin', bg='white', width=5, height=2, command=asin) arcsin.place(x=350,y=300) def acos():
try: content.set(('acos('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")") except ValueError: easygui.msgbox('acos只能填-1到1的数字!') content.set('') except: easygui.msgbox('输入有误!')

arccos = tkinter.Button( calculator, text='acos', bg='white', width=5, height=2, command=acos) arccos.place(x=350,y=350)
def atan():
try: content.set(('atan('+str((eval(content.get().replace('factorial','math.factorial').replace('×', '*').replace('sqrt','math.sqrt').replace('÷', '/').replace('^', '**').replace('π',str(math.pi)). replace('e',str(math.e)).replace('sinr','math.sin').replace('cosr','math.cos').replace('tanr','math.tan').replace("sind","math.sin(math.radians").replace("cosd","math.cos(math.radians") .replace("tand","math.tan(math.radians").replace("asin",'math.asin').replace("acos",'math.acos').replace("atan",'math.atan')))))+")")
except: easygui.msgbox('输入有误!')

arctan = tkinter.Button( calculator, text='atan', bg='white', width=5, height=2, command=atan) arctan.place(x=0,y=300) """反三角函数运算""" def exit(): quit() tuichu= tkinter.Button( calculator, text='退出', bg='white', width=5, height=2, command=exit) tuichu.place(x=0,y=350) calculator.mainloop() # 运行计算器

2020-05-18T22:43:44 点赞:0

【Python作品分享】计算器【作品秀】 中回复

从下至上看

2020-05-18T22:44:16 点赞:0

【Python作品分享】520祝福【作业帖】 中回复

这段文字并非我的原创,摘自

https://www.bilibili.com/video/BV1LZ4y1p7YP的其中一个评论并加以修改

2020-05-20T22:49:29 点赞:1

【Python作品分享】520祝福【作业帖】 中回复

顶!

2020-05-22T18:43:54 点赞:0

【Python作品分享】520祝福【作业帖】 中回复

顶!

2020-05-23T18:47:15 点赞:0

【Python作品分享】雷达侦测器【作品秀】 中回复

emotion_编程猫_搓头

2020-05-23T22:40:49 点赞:0

【Python作品分享】音乐播放器【作品秀】 中回复

3668播放?有人在刷?

2020-05-23T22:50:19 点赞:0

【Python作品分享】www【作品秀】 中回复

床 

2020-05-24T10:34:32 点赞:0

【Python作品分享】turtle弹幕【求助帖】 中回复

我非常想解决这个问题,无奈我不会_thread库,没法帮忙

2020-05-25T22:35:35 点赞:0

【求助】 . 中回复

 

<pre class="language-python"><code>

#测试

</code></pre>

2020-05-26T20:17:11 点赞:0

【求助】 . 中回复

DD

2020-05-26T21:17:06 点赞:0

【Python作品分享】分解质因数2.0【求助帖】 中回复

emotion_编程猫_点赞

2020-05-26T22:39:36 点赞:0

【求助】 . 中回复

<pre class="language-python"><code>#二次测试</code></pre>

2020-05-27T18:36:40 点赞:0

【求助】 . 中回复

<pre class="language-python"><code>

#测试×3

</code></pre>

2020-05-27T20:38:22 点赞:0

【Python作品分享】弹幕发射器【教程贴】 中回复

封面表面作者是学习时偷偷敲的,嘻嘻~

2020-05-28T21:10:07 点赞:1

【Python作品分享】弹幕发射器【教程贴】 中回复

作者建议各位在init函数中加上“self.pen.hideturtle()”这句,隐藏画笔

2020-05-28T21:47:07 点赞:0

【Python作品分享】黄萧晴 翁源县尚同中学 璀璨星河 中回复

center_image

很棒!

如果书架的📕能上色就更好了!

 

emotion_编程猫_点赞

2020-05-29T18:09:26 点赞:0