Python
choueric
这个作者很懒,什么都没留下…
展开
-
Python中时间格式化
import time formate = "%Y-%m-%d %H:%M:%S" formate1 = "%Y-%m-%d" print time.strftime(formate,time.localtime(time.time()))原创 2013-09-12 22:30:53 · 702 阅读 · 0 评论 -
Python判断字符串中是否有中文字符
#-*- coding:utf-8 -*- def is_chinese(s): rt = False if s>= u"\u4e00" and s rt = True return rt ss = "中文测试測試請說ha".decode("utf-8") for row in ss: print row,is_chinese(row)原创 2013-11-27 10:17:07 · 5970 阅读 · 0 评论