首页 > 代码库 > python临时文件之当前星期几
python临时文件之当前星期几
# -*- coding: utf-8 -*-
# python:2.x
__author__ = ‘Administrator‘
import datetime as s
def a():
d={‘Monday‘:u‘星期1‘,
‘Tuesday‘:u‘星期2‘,
‘Wednesday‘:u‘星期3‘,
‘Thursday‘:u‘星期4‘,
‘Friday‘:u‘星期5‘,
‘Saturday‘:u‘星期6‘,
‘Sunday‘:u‘星期7‘}
for k,v in zip(d.iterkeys(),d.itervalues()):
s1=s.datetime.now()
p=u‘星期‘+s1.strftime(‘%w %a‘)
#print ‘%s‘%d[k]
if p in d[k]:
print ‘ok‘
else:
print p,k
s1=s.datetime.now()
p=u‘星期‘+s1.strftime(u‘ %w‘)
times=s.date.today()
print times+s.timedelta(days=0),p
d={‘Monday‘:u‘星期1‘,
‘Tuesday‘:u‘星期2‘,
‘Wednesday‘:u‘星期3‘,
‘Thursday‘:u‘星期4‘,
‘Friday‘:u‘星期5‘,
‘Saturday‘:u‘星期6‘,
‘Sunday‘:u‘星期7‘}
def a(c):
d=[‘a‘,‘b‘,‘c‘,‘d‘,‘e‘]
for b in d:
if c in b:print ‘aa‘
else:
print ‘bb‘
def a(b):
d={‘Monday‘:u‘星期1‘,
‘Tuesday‘:u‘星期2‘,
‘Wednesday‘:u‘星期3‘,
‘Thursday‘:u‘星期4‘,
‘Friday‘:u‘星期5‘,
‘Saturday‘:u‘星期6‘,
‘Sunday‘:u‘星期7‘}
for k in d:
print k
python临时文件之当前星期几