Skip to content

Commit

Permalink
Modify luohou bug
Browse files Browse the repository at this point in the history
  • Loading branch information
china-testing committed Feb 4, 2023
1 parent 404e9e0 commit 2c52e1e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pip install sxtwl bidict
```

Windows下如果安装sxtwl报错,安装 [BuildTools_Full.exe](https://url97.ctfile.com/f/18113597-800958828-d3b94d?p=2274) 点击普通下载,不用注册,访问密码: 2274
注意:sxtwl可能不支持python3.11。 Linux下的兼容性会好很多。

- linux打开终端或windows打开cmd或git的bash或powercmd等工具

Expand Down
7 changes: 5 additions & 2 deletions bazi.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,9 @@ def get_shens(gans, zhis, gan_, zhi_):

# 偏印分析
if '枭' in gan_shens:
print("----偏印在天干如成格:偏印在前,偏财(财次之)在后,有天月德就是佳命(偏印不在月支也麻烦)。忌讳倒食,但是坐绝没有这能力。")
print("----偏印在天干如成格:偏印在前,偏财(财次之)在后,有天月德就是佳命(偏印格在日时,不在月透天干也麻烦)。忌讳倒食,但是坐绝没有这能力。")
print("经典认为:偏印不能扶身,要身旺;偏印见官杀未必是福;喜伤官,喜财;忌日主无根; 女顾兄弟姐妹;男六亲似冰")
print("偏印格干支有冲、合、刑,地支是偏印的绝位也不佳。")
if '枭' in zhi_shens:
print("成格基础89生财、配印;最喜偏财同时成格,偏印在前,偏财在后。最忌讳日时坐实比劫刃。")
if shens2.count('枭') > 2:
Expand Down Expand Up @@ -702,7 +703,7 @@ def get_shens(gans, zhis, gan_, zhi_):
# 偏财分析
if '才' in gan_shens:
print("偏财明现天干,不论是否有根:财富外人可见;实际财力不及外观一半。没钱别人都不相信;协助他人常超过自己的能力")
print("偏财出天干,又与天月德贵人同一天干者。在年月有声明远扬的父亲,月时有聪慧的红颜知己。")
print("偏财出天干,又与天月德贵人同一天干者。在年月有声明远扬的父亲,月时有聪慧的红颜知己。喜奉承。")
print("偏财透天干,四柱没有刑冲,长寿。女子为孝顺女,主要针对年月。时柱表示中年以后有自己的事业,善于理财。")
if '才' in zhi_shens:
print("财格基础80:比劫用食伤通关或官杀制;身弱有比劫仍然用食伤通关。如果时柱坐实比劫,晚年破产。")
Expand All @@ -723,6 +724,8 @@ def get_shens(gans, zhis, gan_, zhi_):
print("偏财坐阳刃劫财,可做父缘薄,也可幼年家贫。也可以父先亡,要参考第一大运。")
if len(zhi5[zhis[seq]]) == 1:
print("偏财坐专位阳刃劫财,父亲去他乡。")
if get_empty(zhus[2],zhis[seq]) == '空':
print("偏财坐空亡,财官难求。")

if shens2.count('才') > 2:
print("偏财多的人慷慨,得失看淡。花钱一般不会后悔。偏乐观,甚至是浮夸。生活习惯颠倒。适应能力强。有团队精神。得女性欢心。小事很少失信。")
Expand Down
31 changes: 18 additions & 13 deletions luohou.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,28 @@
d = datetime.datetime.today()

def get_hou(d):
lunar = sxtwl.Lunar();
cal_day = lunar.getDayBySolar(d.year, d.month, d.day)
cal_day = sxtwl.fromSolar(d.year, d.month, d.day)


# 计算甲干相合
gans = Gans(year=Gan[cal_day.Lyear2.tg], month=Gan[cal_day.Lmonth2.tg],
day=Gan[cal_day.Lday2.tg])
zhis = Zhis(year=Zhi[cal_day.Lyear2.dz], month=Zhi[cal_day.Lmonth2.dz],
day=Zhi[cal_day.Lday2.dz])
gz = cal_day.getHourGZ(10)
yTG = cal_day.getYearGZ()
mTG = cal_day.getMonthGZ()
dTG = cal_day.getDayGZ()


gans = Gans(year=Gan[yTG.tg], month=Gan[mTG.tg],
day=Gan[dTG.tg])
zhis = Zhis(year=Zhi[yTG.dz], month=Zhi[mTG.dz],
day=Zhi[dTG.dz])


print("公历:", end='')
print("{}年{}月{}日".format(cal_day.y, cal_day.m, cal_day.d), end='')
print("{}年{}月{}日".format(d.year, d.month, d.day), end='')

Lleap = "闰" if cal_day.Lleap else ""
Lleap = "闰" if cal_day.isLunarLeap() else ""
print("\t农历:", end='')
print("{}年{}{}月{}日 ".format(cal_day.Lyear0 + 1984, Lleap, ymc[cal_day.Lmc], rmc[cal_day.Ldi]), end='')
print("{}年{}{}月{}日 ".format(cal_day.getLunarYear(), Lleap,cal_day.getLunarMonth(), cal_day.getLunarDay()), end='')
print(' \t',end='')
print('-'.join([''.join(item) for item in zip(gans, zhis)]), end='')

Expand All @@ -84,15 +89,15 @@ def get_hou(d):
print(" \t年猴:{}年{}日".format(zhis[0], day_ganzhi), end=' ')


if zhis[2] == yue_hous[ymc[cal_day.Lmc]]:
if zhis[2] == yue_hous[ymc[cal_day.getLunarMonth()]]:
print(" \t月罗:{}日".format(zhis[2]), end=' ')

if day_ganzhi in tuple(ji_hous.values()):
birthday = d
for i in range(30):
day_ = sxtwl.Lunar().getDayBySolar(birthday.year, birthday.month, birthday.day)
if day_.qk != -1:
ji = jis[(day_.qk + 3)//6]
day_ = sxtwl.fromSolar(birthday.year, birthday.month, birthday.day)
if day_.hasJieQi():
ji = jis[(day_.getJieQi() + 3)//6]
break
birthday += datetime.timedelta(days=-1)

Expand Down

0 comments on commit 2c52e1e

Please sign in to comment.