使用python语言实现在控制台打印日历 输入年.月.日 输出对应日历,指定的日数输出为'--' 程序没有做严格的输入验证,故输入整数即可. 以下为没有优化的源码: print_calendar.py #输出日历 def print_calendar(year,month,date = 1): month_dict = {':'July', ':'December'} #数字月份转换为字符串,并判断月份和号数是否合法 if month in range(1,13) and date in ran…
1.简单的Python脚本 Appium中的设置与Appium学习实践(一)简易运行Appium中的一致 Launch后,执行脚本 #coding:utf-8 import unittest import os from selenium import webdriver from time import sleep class Dttest(unittest.TestCase): def setUp(self): self.driver = webdriver.Remote( command_…
#未优化的代码 1 #输出日历 def print_calendar(year,month,date = 1): month_dict = {':'July', ':'December'} #数字月份转换为字符串,并判断月份和号数是否合法 if month in range(1,13) and date in range(1,31): month_str = str(month) if month_str in month_dict: month_str = month_dict[month_s…