易截截图软件、单文件、免安装、纯绿色、仅160KB

python中获得某月有多少天的函数

  偶然需要用到这样一个函数,在Delphi中,有现成的函数可以调用!在python中,我找了半天都还没找到,最后自己写了一个函数如下:
def dayOfMonth(date):
if date.month == 12:
return 31
else:
return (date.replace(month=date.month+1, day=1) - datetime.timedelta(days=1)).day

后来在国外网站上,偶然发现了一个说明,发现,原来,python中还是带有这样的函数的!
monthrange(year, month)
    Returns weekday of first day of the month and number of days in month, for the specified year and month.
这个函数就是,返回星期的数量和本月的天数,需要引用calendar
>>>

import
calendar
>>>
calendar
.
monthrange
(
2002
,
1
)
(
1
,

31
)
>>>
calendar
.
monthrange
(
2008
,
2
)
(
4
,

29
)
>>>
calendar
.
monthrange
(
2100
,
2
)
(
0
,

28
)


相关文档:

python 练手


可以播放大部分的音视频.
demo download:  http://www.sandy1219.com/python/media.rar
playMP3.py
# -*- coding: utf-8 -*-
import wx;
import wx.media;
import os;
import SPrint;
import mediaStateBar;
import mediaList;
import SaveLog;
import MediaItem;
woldcart = "media files|*.*|avi ......

Python模块学习

  copy模块用于对象的拷贝操作。该模块非常简单,只提供了两个主要的方法:
copy.copy

copy.deepcopy
,分别表示浅复制与深复制。什么是浅复制,什么是深复制,网上有一卡车一卡车的资料,这里不作详细介绍。复制操作只对复合对象有效。用简单的例子来分别介绍这两个方法。
浅复制只复制对象本身,没有复制该对象 ......

Best Replica Gucci Galaxy Python Hobo Bag

ZoundryDocument
Python skin is known for its color variations and for its elasticity; it is
the warmest leather of the season and ideal for the manufacture of many luxury
goods. Sometimes natural patterns can be hidden when they're done in black, but
the finish here has a bit of a shine to it ......

Python GUI

1. 事件驱动
    一个事件及其回调的例子是鼠标移动。我们假设鼠标指针停在您GUI 程序的某处。如果鼠标被移到了程序的别处,一定是有什么东西引起了屏幕上指针的移动,从而表现这种位置的转移。系统必须处理这些鼠标移动事件才能展现(并实现)鼠标在窗口上的移动。一旦您释放了鼠标,就不再会有事件需要处 ......

程序 python 抓取新浪读书频道小说

二进制文件下载地址:
SinaGetBook
效果如图:
代码:
#!/usr/bin/env python
#coding=utf-8
#!/usr/bin/env python
#coding=utf-8
import traceback
import sys
import wx
import re
import urllib
import wx.richtext as rt
import wx.lib.buttonpanel as bp
import Casing
import Debug
def trace_back ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号