本文整理汇总了Python中Menu.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.clear方法的具体用法?Python Menu.clear怎么用?Python Menu.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu.clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_data
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import clear [as 别名]
def show_data():
# show all data in our diary
Menu.clear()
print('Date\t\tTemp\tPreasure\tHumidity\tWind Speed\tWind Direction\tPrecipitation')
count = 0
for i in W_diary.weather:
print(i.isoformat() + '\t' + str(W_diary.weather[i][0]) +
'\t' + str(W_diary.weather[i][1]) + '\t\t' +
str(W_diary.weather[i][2]) + '\t\t' +
str(W_diary.weather[i][3]) + '\t\t' +
str(W_diary.weather[i][4]) +
'\t\t' + str(W_diary.weather[i][5]))
count += 1
if not count:
print('Diary is empty')
input('Press Enter to continue...')
示例2: show_data_by_month
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import clear [as 别名]
def show_data_by_month():
# show weather during chosen month
Menu.clear()
year = Input.get_year()
month = Input.get_month() # reading month number
count = 0
print('Date\t\tTemp\tPreasure\tHumidity\tWind Speed\tWind Direction\tPrecipitation')
for i in W_diary.weather: # show all data about thise month that exsist in diary
if (i.year == year) & (i.month == month):
print(i.isoformat() + '\t' +
str(W_diary.weather[i][0]) + '\t' +
str(W_diary.weather[i][1]) + '\t\t' +
str(W_diary.weather[i][2]) + '\t\t' +
str(W_diary.weather[i][3]) + '\t\t' +
str(W_diary.weather[i][4]) + '\t\t' +
str(W_diary.weather[i][5]))
count += 1
if not count:
print('Diary is empty')
input('Press Enter to continue...')