[Tutor] Cal command in python...
Kent Johnson
kent37 at tds.net
Thu Nov 2 13:52:26 CET 2006
Asrarahmed Kadri wrote:
>
> I got the command and saw its output..? But where to look for the source
> code..?
> Which library ?
In the Python standard library. Much of the library is written in Python
and supplied as source. On Windows it will be something like
C:\Python25\Lib\calendar.py. On other platforms I don't know the path
but it will be part of the Python installation.
Kent
>
> TIA.
>
> Regards,
> Asrarahmed
>
>
>
> On 11/2/06, *Kent Johnson* <kent37 at tds.net <mailto:kent37 at tds.net>> wrote:
>
> Asrarahmed Kadri wrote:
> >
> >
> > Folks,
> >
> > Does anybody have an idea of the logic used in cal command... I
> want to
> > know the algorithm so that I can implement in Python.
>
> See the calendar module. Source code in the library if you want to see
> how it is done.
>
> In [1]: import calendar
>
> In [2]: calendar.prmonth (2006, 10)
> October 2006
> Mo Tu We Th Fr Sa Su
> 1
> 2 3 4 5 6 7 8
> 9 10 11 12 13 14 15
> 16 17 18 19 20 21 22
> 23 24 25 26 27 28 29
> 30 31
>
> Kent
>
>
>
>
> --
> To HIM you shall return.
More information about the Tutor
mailing list