LinMC
 1 -*- coding:utf-8 -*-
 2 #Author:\'Lmc\'
 3 #DATE: 2019/4/23/0023 下午 4:23:08
 4 #FileName:tem_compare_gui.PY
 5 import easygui
 6 string = \'\' #初始化
 7 
 8 def tem_compare(string):
 9     string = easygui.choicebox(\'请选择功能!\', choices=[\'摄氏温度转华氏温度\', \'华氏温度转摄氏温度\'])
10     while string == \'摄氏温度转华氏温度\':
11         c = float(easygui.enterbox(\'请输入摄氏温度\'))
12         f = c * 1.8 + 32    #华氏温度转摄氏温度公式
13         f1 = float(\'%.1f\'%f)
14         easygui.msgbox(\'华氏温度为\'+ str(f1))
15         tem_compare(string)
16         break
17 
18     while string == \'华氏温度转摄氏温度\':
19         f = float(easygui.enterbox(\'请输入华氏温度\'))
20         c = (f - 32) / 1.8  #摄氏温度转华氏温度公式
21         c1 = float(\'%.1f\'%c)
22         easygui.msgbox(\'温度度为\' + str(c1))
23         tem_compare(string)
24         break
25 
26 tem_compare(string)

 

分类:

技术点:

相关文章:

  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-03-20
  • 2021-05-09
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-04-30
  • 2021-12-01
  • 2021-09-06
  • 2022-12-23
相关资源
相似解决方案