from time import strftime
print strftime('%A %B %dth')
EDIT:
Correcting after having seen the answers of gurus:
from time import strftime
def special_strftime(dic = {'01':'st','21':'st','31':'st',
'02':'nd','22':'nd',
'03':'rd','23':'rd'}):
x = strftime('%A %B %d')
return x + dic.get(x[-2:],'th')
print special_strftime()
.
EDIT 2
Also:
from time import strftime
def special_strftime(dic = {'1':'st','2':'nd','3':'rd'}):
x = strftime('%A %B %d')
return x + ('th' if x[-2:] in ('11','12','13')
else dic.get(x[-1],'th')
print special_strftime()
.
EDIT 3
Finally, it can be simplified:
from time import strftime
def special_strftime(dic = {'1':'st','2':'nd','3':'rd'}):
x = strftime('%A %B %d')
return x + ('th' if x[-2]=='1' else dic.get(x[-1],'th')
print special_strftime()