国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python實現的陽歷轉陰歷(農歷)算法

2020-02-23 05:20:00
字體:
來源:轉載
供稿:網友


搜索了好幾個python實現的萬年歷多有部分時間有問題,好多是來自這個代碼:

代碼如下:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Usage:  ccal Month [4-Digit-Year]
   or:  ccal 4-Digit-Year Month

This Python script is to show Solar and Lunar calender at the
same time. You need to have Python (2.0 or above) installed.

Acceptable date range:  1900/2 -- 2049/12

Output contains Chinese characters (mainland GB2312 encoding),
must be viewed in a Chinese-enabled system or "cxterm" etc.
programms under UNIX X-Windows.

The major reference for me to compose this program is:
lunar-2.1.tgz (1992), composed by
    Fung F. Lee <lee@umunhum.stanford.edu> and
    Ricky Yeung  <Ricky.Yeung@Eng.Sun.Com> .

And Lee and Yeung refered to:
    1. "Zhong1guo2 yin1yang2 ri4yue4 dui4zhao4 wan4nian2li4"
 by Lin2 Qi3yuan2. 《中國陰陽日月對照萬年歷》.林
    2. "Ming4li3 ge2xin1 zi3ping2 cui4yan2" by Xu2 Le4wu2.
 《命理革新子平粹言》.徐
    3.  Da1zhong4 wan4nian2li4. 《大眾萬年歷》

License:
    GNU General Public License (GPL, see http://www.gnu.org).
    In short, users are free to use and distribute this program
    in whole. If users make revisions and distribute the revised
    one, they are required to keep the revised source accessible
    to the public.

Version:
    0.3.2,  Jan/16/2007, according to sprite's information, changed 3 codes:
            1954: 0x0a5d0 --> 0x0a5b0, 1956: 0x052d0 --> 0x052b0
            1916: 0x0d6a0 --> 0x056a0
    0.3.1,  Jan/15/2007, changed 1978's code from 0xb5a0 to 0xb6a0.
            A young lady's birth day (lunar 1978/8/4) problem reported
            on internet -- informed by sprite at linuxsir.org
    0.3.0,  Sep/25/2006, add coding line, prevent python to report warning
    0.2.0,  Jan/6/2002, ShengXiao(生肖), lunar leap month(閏月)
            added.
    0.1.0,  Jan/4/2002

 --- Changsen Xu <xucs007@yahoo.com>
'''

#Remember, in this program:
#   month=0 means Januaray, month=1 means February ...;
#   day=0 means the first day of a month, day=1 means the second day,
#       so as to ease manipulation of Python lists.
#   year=0 is 1900, until the last step to output

daysInSolarMonth= [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 平湖市| 武穴市| 奇台县| 盐山县| 龙南县| 株洲县| 清新县| 利川市| 揭西县| 华亭县| 岑溪市| 论坛| 谷城县| 永吉县| 陇川县| 宁海县| 和平县| 曲水县| 托里县| 卢龙县| 黑龙江省| 合江县| 百色市| 绥芬河市| 海宁市| 台南市| 翁源县| 宝应县| 砚山县| 定南县| 南部县| 阿荣旗| 昭平县| 碌曲县| 福建省| 县级市| 邵东县| 东海县| 文水县| 扎鲁特旗| 东台市|