一、判断字符串,内容是否为数字python
咱们用python;xlrd读Excel内容时,原本只是输入的整数字,常常读出来的是float类型函数
咱们须要自动转成整型,意思就是说,读出来的和咱们输入的同样,可是,咱们不能直接用int转换,缘由呢,咱们没法肯定读的每一个单元格的值都是数字spa
那么咱们本身,定认一个函数以下:code
def isNumeric(value): try: tv = float(value) return int(tv) except ValueError: return value
二、获取当前系统时间blog
import time
#获取当前系统时间 def getCurTime(self): curTimeStr = time.strftime('%Y-%m-%d_%H-%M-%S',time.localtime()).decode('utf-8') return curTimeStr
三、utf-8