forked from china-testing/bazi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbazi.py
executable file
·2426 lines (1904 loc) · 113 KB
/
bazi.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: 钉钉、抖音或微信pythontesting 钉钉群21734177
# CreateDate: 2019-2-21
import sxtwl
import argparse
import collections
import pprint
import datetime
from lunar_python import Lunar
from colorama import init
from datas import *
from sizi import summarys
from common import *
def gan_zhi_he(zhu):
gan, zhi = zhu
if ten_deities[gan]['合'] in zhi5[zhi]:
return "|"
return ""
def get_gong(zhis):
result = []
for i in range(3):
if gans[i] != gans[i+1]:
continue
zhi1 = zhis[i]
zhi2 = zhis[i+1]
if abs(Zhi.index(zhi1) - Zhi.index(zhi2)) == 2:
value = Zhi[(Zhi.index(zhi1) + Zhi.index(zhi2))//2]
#if value in ("丑", "辰", "未", "戌"):
result.append(value)
if (zhi1 + zhi2 in gong_he) and (gong_he[zhi1 + zhi2] not in zhis):
result.append(gong_he[zhi1 + zhi2])
#if (zhi1 + zhi2 in gong_hui) and (gong_hui[zhi1 + zhi2] not in zhis):
#result.append(gong_hui[zhi1 + zhi2])
return result
def get_shens(gans, zhis, gan_, zhi_):
all_shens = []
for item in year_shens:
if zhi_ in year_shens[item][zhis.year]:
all_shens.append(item)
for item in month_shens:
if gan_ in month_shens[item][zhis.month] or zhi_ in month_shens[item][zhis.month]:
all_shens.append(item)
for item in day_shens:
if zhi_ in day_shens[item][zhis.day]:
all_shens.append(item)
for item in g_shens:
if zhi_ in g_shens[item][me]:
all_shens.append(item)
if all_shens:
return " 神:" + ' '.join(all_shens)
else:
return ""
def jin_jiao(first, second):
return True if Zhi.index(second) - Zhi.index(first) == 1 else False
def is_ku(zhi):
return True if zhi in "辰戌丑未" else False
def zhi_ku(zhi, items):
return True if is_ku(zhi) and min(zhi5[zhi], key=zhi5[zhi].get) in items else False
def is_yang():
return True if Gan.index(me) % 2 == 0 else False
def not_yang():
return False if Gan.index(me) % 2 == 0 else True
def gan_ke(gan1, gan2):
return True if ten_deities[gan1]['克'] == ten_deities[gan2]['本'] or ten_deities[gan2]['克'] == ten_deities[gan1]['本'] else False
description = '''
'''
parser = argparse.ArgumentParser(description=description,
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('year', action="store", help=u'year')
parser.add_argument('month', action="store", help=u'month')
parser.add_argument('day', action="store", help=u'day')
parser.add_argument('time', action="store",help=u'time')
parser.add_argument("--start", help="start year", type=int, default=1850)
parser.add_argument("--end", help="end year", default='2030')
parser.add_argument('-b', action="store_true", default=False, help=u'直接输入八字')
parser.add_argument('-g', action="store_true", default=False, help=u'是否采用公历')
parser.add_argument('-r', action="store_true", default=False, help=u'是否为闰月,仅仅使用于农历')
parser.add_argument('-n', action="store_true", default=False, help=u'是否为女,默认为男')
parser.add_argument('--version', action='version',
version='%(prog)s 1.0 Rongzhong xu 2022 06 15')
options = parser.parse_args()
Gans = collections.namedtuple("Gans", "year month day time")
Zhis = collections.namedtuple("Zhis", "year month day time")
if options.b:
gans = Gans(year=options.year[0], month=options.month[0],
day=options.day[0], time=options.time[0])
zhis = Gans(year=options.year[1], month=options.month[1],
day=options.day[1], time=options.time[1])
jds = sxtwl.siZhu2Year(getGZ(options.year), getGZ(options.month), getGZ(options.day), getGZ(options.time), options.start, int(options.end));
for jd in jds:
t = sxtwl.JD2DD(jd )
print("可能出生时间: python bazi.py -g %d %d %d %d :%d:%d"%(t.Y, t.M, t.D, t.h, t.m, round(t.s)))
else:
if options.g:
day = sxtwl.fromSolar(
int(options.year), int(options.month), int(options.day))
else:
day = sxtwl.fromLunar(
int(options.year), int(options.month), int(options.day), options.r)
gz = day.getHourGZ(int(options.time))
yTG = day.getYearGZ()
mTG = day.getMonthGZ()
dTG = day.getDayGZ()
# 计算甲干相合
gans = Gans(year=Gan[yTG.tg], month=Gan[mTG.tg],
day=Gan[dTG.tg], time=Gan[gz.tg])
zhis = Zhis(year=Zhi[yTG.dz], month=Zhi[mTG.dz],
day=Zhi[dTG.dz], time=Zhi[gz.dz])
me = gans.day
month = zhis.month
alls = list(gans) + list(zhis)
zhus = [item for item in zip(gans, zhis)]
gan_shens = []
for seq, item in enumerate(gans):
if seq == 2:
gan_shens.append('--')
else:
gan_shens.append(ten_deities[me][item])
#print(gan_shens)
zhi_shens = [] # 地支的主气神
for item in zhis:
d = zhi5[item]
zhi_shens.append(ten_deities[me][max(d, key=d.get)])
#print(zhi_shens)
shens = gan_shens + zhi_shens
zhi_shens2 = [] # 地支的所有神,包含余气和尾气, 混合在一起
zhi_shen3 = [] # 地支所有神,字符串格式
for item in zhis:
d = zhi5[item]
tmp = ''
for item2 in d:
zhi_shens2.append(ten_deities[me][item2])
tmp += ten_deities[me][item2]
zhi_shen3.append(tmp)
shens2 = gan_shens + zhi_shens2
# 计算五行分数 http://www.131.com.tw/word/b3_2_14.htm
scores = {"金":0, "木":0, "水":0, "火":0, "土":0}
gan_scores = {"甲":0, "乙":0, "丙":0, "丁":0, "戊":0, "己":0, "庚":0, "辛":0,
"壬":0, "癸":0}
for item in gans:
scores[gan5[item]] += 5
gan_scores[item] += 5
for item in list(zhis) + [zhis.month]:
for gan in zhi5[item]:
scores[gan5[gan]] += zhi5[item][gan]
gan_scores[gan] += zhi5[item][gan]
# 计算八字强弱
# 子平真诠的计算
weak = True
me_status = []
for item in zhis:
me_status.append(ten_deities[me][item])
if ten_deities[me][item] in ('长', '帝', '建'):
weak = False
if weak:
if shens.count('比') + me_status.count('库') >2:
weak = False
# 计算大运
seq = Gan.index(gans.year)
if options.n:
if seq % 2 == 0:
direction = -1
else:
direction = 1
else:
if seq % 2 == 0:
direction = 1
else:
direction = -1
dayuns = []
gan_seq = Gan.index(gans.month)
zhi_seq = Zhi.index(zhis.month)
for i in range(12):
gan_seq += direction
zhi_seq += direction
dayuns.append(Gan[gan_seq%10] + Zhi[zhi_seq%12])
# 网上的计算
me_attrs_ = ten_deities[me].inverse
strong = gan_scores[me_attrs_['比']] + gan_scores[me_attrs_['劫']] \
+ gan_scores[me_attrs_['枭']] + gan_scores[me_attrs_['印']]
if not options.b:
#print("direction",direction)
sex = '女' if options.n else '男'
print("\n{}命".format(sex))
print("======================================")
print("公历:", end='')
print("\t{}年{}月{}日".format(day.getSolarYear(), day.getSolarMonth(), day.getSolarDay()))
Lleap = "闰" if day.isLunarLeap() else ""
lunar = Lunar.fromYmdHms(day.getLunarYear(), day.getLunarMonth(), day.getLunarDay(),int(options.time), 0, 0)
ba = lunar.getEightChar()
print("lunar_python:", ba)
#print(ba.getDayZhi())
#print(not options.n)
yun = ba.getYun(1)
#yun_day = "{}年{}月{}日"
print("农历:", end='')
print("\t{}年{}{}月{}日 穿=害 上运时间:".format(day.getLunarYear(), Lleap, day.getLunarMonth(), day.getLunarDay(), yun.getStartSolar().toFullString()))
print("-"*120)
print("墓库:", str(kus).replace("'",""), "解读:钉ding或v信pythontesting", end=' ')
for item in zhus:
print(''.join(item), end=' ')
print()
print("甲己-中正土 乙庚-仁义金 丙辛-威制水 丁壬-淫慝木 戊癸-无情火", " 三会:", str(zhi_huis).replace("'",""))
print("="*120)
#print(zhi_3hes, "生:寅申巳亥 败:子午卯酉 库:辰戌丑未")
#print("地支六合:", zhi_6hes)
out = ''
for item in zhi_3hes:
out = out + "{}:{} ".format(item, zhi_3hes[item])
print('\033[1;36;40m' + ' '.join(list(gans)), ' '*5, ' '.join(list(gan_shens)) + '\033[0m',' '*5, out,)
out = ''
for item in zhi_6hes:
out = out + "{}{} ".format(item, zhi_6hes[item])
print('\033[1;36;40m' + ' '.join(list(zhis)), ' '*5, ' '.join(list(zhi_shens)) + '\033[0m', ' '*5, "生:寅申巳亥 败:子午卯酉 库:辰戌丑未", ' '*2, out)
print("-"*120)
print("{1:{0}^15s}{2:{0}^15s}{3:{0}^15s}{4:{0}^15s}".format(chr(12288), '【年】{}:{}{}{}'.format(temps[gans.year],temps[zhis.year],ten_deities[gans.year].inverse['建'], gan_zhi_he(zhus[0])),
'【月】{}:{}{}{}'.format(temps[gans.month],temps[zhis.month], ten_deities[gans.month].inverse['建'], gan_zhi_he(zhus[1])),
'【日】{}:{}{}'.format(temps[me], temps[zhis.day], gan_zhi_he(zhus[2])),
'【时】{}:{}{}{}'.format(temps[gans.time], temps[zhis.time], ten_deities[gans.time].inverse['建'], gan_zhi_he(zhus[3]))))
print("-"*120)
print("\033[1;36;40m{1:{0}<15s}{2:{0}<15s}{3:{0}<15s}{4:{0}<15s}\033[0m".format(
chr(12288),
'{}{}{}【{}】{}'.format(
gans.year, yinyang(gans.year), gan5[gans.year], ten_deities[me][gans.year], check_gan(gans.year, gans)),
'{}{}{}【{}】{}'.format(
gans.month, yinyang(gans.month), gan5[gans.month], ten_deities[me][gans.month], check_gan(gans.month, gans)),
'{}{}{}{}'.format(me, yinyang(me),gan5[me], check_gan(me, gans)),
'{}{}{}【{}】{}'.format(gans.time, yinyang(gans.time), gan5[gans.time], ten_deities[me][gans.time], check_gan(gans.time, gans)),
))
print("\033[1;36;40m{1:{0}<15s}{2:{0}<15s}{3:{0}<15s}{4:{0}<15s}\033[0m".format(
chr(12288),
"{}{}{}【{}】{}".format(
zhis.year, yinyang(zhis.year), ten_deities[me][zhis.year],
ten_deities[gans.year][zhis.year], get_empty(zhus[2],zhis.year)),
"{}{}{}【{}】{}".format(
zhis.month, yinyang(zhis.month), ten_deities[me][zhis.month],
ten_deities[gans.month][zhis.month], get_empty(zhus[2],zhis.month)),
"{}{}{}".format(zhis.day, yinyang(zhis.day), ten_deities[me][zhis.day]),
"{}{}{}【{}】{}".format(
zhis.time, yinyang(zhis.time), ten_deities[me][zhis.time],
ten_deities[gans.time][zhis.time], get_empty(zhus[2],zhis.time)),
))
statuses = [ten_deities[me][item] for item in zhis]
for seq, item in enumerate(zhis):
out = ''
multi = 2 if item == zhis.month and seq == 1 else 1
for gan in zhi5[item]:
out = out + "{}{}{} ".format(gan, gan5[gan], ten_deities[me][gan])
print("\033[1;36;40m{1:{0}<15s}\033[0m".format(chr(12288), out.rstrip(' ')), end='')
print()
# 输出地支关系
for seq, item in enumerate(zhis):
output = ''
others = zhis[:seq] + zhis[seq+1:]
for type_ in zhi_atts[item]:
flag = False
if type_ in ('害',"破","会",'刑'):
continue
for zhi in zhi_atts[item][type_]:
if zhi in others:
if not flag:
output = output + " " + type_ + ":" if type_ not in ('冲','暗') else output + " " + type_
flag = True
if type_ not in ('冲','暗'):
output += zhi
output = output.lstrip(' ')
print("\033[1;36;40m{1:{0}<15s}\033[0m".format(chr(12288), output), end='')
print()
# 输出地支minor关系
for seq, item in enumerate(zhis):
output = ''
others = zhis[:seq] + zhis[seq+1:]
for type_ in zhi_atts[item]:
flag = False
if type_ not in ('害',"会"):
continue
for zhi in zhi_atts[item][type_]:
if zhi in others:
if not flag:
output = output + " " + type_ + ":"
flag = True
output += zhi
output = output.lstrip(' ')
print("\033[1;36;40m{1:{0}<15s}\033[0m".format(chr(12288), output), end='')
print()
for seq, item in enumerate(zhus):
# 检查空亡
result = "{}-{}".format(nayins[item], '亡') if zhis[seq] == wangs[zhis[0]] else nayins[item]
# 天干与地支关系
result = relations[(gan5[gans[seq]], zhi_wuhangs[zhis[seq]])] + result
# 检查劫杀
result = "{}-{}".format(result, '劫杀') if zhis[seq] == jieshas[zhis[0]] else result
# 检查元辰
result = "{}-{}".format(result, '元辰') if zhis[seq] == Zhi[(Zhi.index(zhis[0]) + direction*-1*5)%12] else result
print("{1:{0}<15s} ".format(chr(12288), result), end='')
print()
all_ges = []
# 神煞计算
strs = ['','','','',]
all_shens = set()
all_shens_list = []
for item in year_shens:
for i in (1,2,3):
if zhis[i] in year_shens[item][zhis.year]:
strs[i] = item if not strs[i] else strs[i] + chr(12288) + item
all_shens.add(item)
all_shens_list.append(item)
for item in month_shens:
for i in range(4):
if gans[i] in month_shens[item][zhis.month] or zhis[i] in month_shens[item][zhis.month]:
strs[i] = item if not strs[i] else strs[i] + chr(12288) + item
if i == 2 and gans[i] in month_shens[item][zhis.month]:
strs[i] = strs[i] + "●"
all_shens.add(item)
all_shens_list.append(item)
for item in day_shens:
for i in (0,1,3):
if zhis[i] in day_shens[item][zhis.day]:
strs[i] = item if not strs[i] else strs[i] + chr(12288) + item
all_shens.add(item)
all_shens_list.append(item)
for item in g_shens:
for i in range(4):
if zhis[i] in g_shens[item][me]:
strs[i] = item if not strs[i] else strs[i] + chr(12288) + item
all_shens.add(item)
all_shens_list.append(item)
# print(all_shens_list)
#print(strs)
for seq in range(2):
print("{1:{0}<15s} ".format(chr(12288), strs[seq]), end='')
for seq in range(2,4):
print("{1:{0}<14s} ".format(chr(12288), strs[seq]), end='')
# 计算六合:相邻的才算合
zhi_6he = [False, False, False, False]
for i in range(3):
if zhi_atts[zhis[i]]['六'] == zhis[i+1]:
zhi_6he[i] = zhi_6he[i+1] = True
# 计算六冲:相邻的才算合
zhi_6chong = [False, False, False, False]
for i in range(3):
if zhi_atts[zhis[i]]['冲'] == zhis[i+1]:
zhi_6chong[i] = zhi_6chong[i+1] = True
# 计算干合:相邻的才算合
gan_he = [False, False, False, False]
for i in range(3):
if (gans[i],gans[i+1]) in set(gan_hes) or (gans[i+1],gans[i]) in set(gan_hes):
gan_he[i] = gan_he[i+1] = True
# 计算刑:相邻的才算
zhi_xing = [False, False, False, False]
for i in range(3):
if zhi_atts[zhis[i]]['刑'] == zhis[i+1] or zhi_atts[zhis[i+1]]['刑'] == zhis[i]:
zhi_xing[i] = zhi_xing[i+1] = True
print()
print("-"*120)
me_lu = ten_deities[me].inverse['建']
me_jue = ten_deities[me].inverse['绝']
me_tai = ten_deities[me].inverse['胎']
me_di = ten_deities[me].inverse['帝']
shang = ten_deities[me].inverse['伤']
shang_lu = ten_deities[shang].inverse['建']
shang_di = ten_deities[shang].inverse['帝']
yin = ten_deities[me].inverse['印']
yin_lu = ten_deities[yin].inverse['建']
xiao = ten_deities[me].inverse['枭']
xiao_lu = ten_deities[xiao].inverse['建']
cai = ten_deities[me].inverse['财']
cai_lu = ten_deities[cai].inverse['建']
cai_di = ten_deities[cai].inverse['帝']
piancai = ten_deities[me].inverse['才']
piancai_lu = ten_deities[piancai].inverse['建']
piancai_di = ten_deities[piancai].inverse['帝']
guan = ten_deities[me].inverse['官']
guan_lu = ten_deities[guan].inverse['建']
guan_di = ten_deities[guan].inverse['帝']
sha = ten_deities[me].inverse['杀']
sha_lu = ten_deities[sha].inverse['建']
sha_di = ten_deities[sha].inverse['帝']
jie = ten_deities[me].inverse['劫']
shi = ten_deities[me].inverse['食']
shi_lu = ten_deities[shi].inverse['建']
shi_di = ten_deities[shi].inverse['帝']
me_ku = ten_deities[me]['库'][0]
cai_ku = ten_deities[cai]['库'][0]
guan_ku = ten_deities[guan]['库'][0]
yin_ku = ten_deities[yin]['库'][0]
shi_ku = ten_deities[shi]['库'][0]
print("调候:", tiaohous['{}{}'.format(me, zhis[1])], "\t##金不换大运:", jinbuhuan['{}{}'.format(me, zhis[1])])
print("金不换大运:说明:", jins['{}'.format(me)])
print("格局选用:", ges[ten_deities[me]['本']][zhis[1]])
if len(set('寅申巳亥')&set(zhis)) == 0:
print("缺四生:一生不敢作为")
if len(set('子午卯酉')&set(zhis)) == 0:
print("缺四柱地支缺四正,一生避是非")
if len(set('辰戌丑未')&set(zhis)) == 0:
print("四柱地支缺四库,一生没有潜伏性凶灾。")
if ( '甲', '戊', '庚',) in (tuple(gans)[:3], tuple(gans)[1:]):
print("地上三奇:白天生有申佳,")
if ( '辛', '壬', '癸',) in (tuple(gans)[:3], tuple(gans)[1:]):
print("人间三奇")
if ( '乙', '丙', '丁',) in (tuple(gans)[:3], tuple(gans)[1:]):
print("天上三奇:晚上生有亥佳")
if zhi_shens2.count('亡神') > 1:
print("二重亡神,先丧母;")
if get_empty(zhus[2],zhis.time):
print("时坐空亡,子息少。 母法P24-41 母法P79-4:损破祖业,后另再成就。")
if zhis.count(me_jue) + zhis.count(me_tai) > 2:
print("胎绝超过3个:夭或穷。母法P24-44 丁未 壬子 丙子 戊子")
if not_yang() and zhi_ku(zhis[2], (me,jie)) and zhi_ku(zhis[3], (me,jie)):
print("阴日主时日支入比劫库:性格孤独,难发达。母法P28-112 甲申 辛未 辛丑 己丑 母法P55-11 为人孤独,且有灾疾")
#print(cai_lu, piancai_lu)
if zhis[1:].count(piancai_lu) + zhis[1:].count(cai_lu) + zhis[1:].count(piancai_di) + zhis[1:].count(cai_di) == 0:
print("月日时支没有财或偏财的禄旺。")
if zhis[1:].count(guan_lu) + zhis[1:].count(guan_di) == 0:
print("月日时支没有官的禄旺。")
if emptie4s.get(zhus[2], 0) != 0:
if scores[emptie4s.get(zhus[2], 0)] == 0:
print("四大空亡:33岁以前身体不佳!")
for item in all_shens:
print(item, ":", shens_infos[item])
if options.n:
print("#"*20, "女命")
if all_shens_list.count("驿马") > 1:
print("二逢驿马,母家荒凉。P110 丙申 丙申 甲寅 丁卯")
if gan_shens[0] == '伤':
print("年上伤官:带疾生产。P110 戊寅 戊午 丁未 丁未")
print("-"*120)
children = ['食','伤'] if options.n else ['官','杀']
liuqins = bidict({'才': '婆婆' if options.n else '父亲',"财":'父亲' if options.n else '妻子', "印": '女婿'if options.n else '母亲', "枭": '母亲'if options.n else '祖父',
"官":'丈夫' if options.n else '女儿', "杀":'情夫' if options.n else '儿子', "劫":'兄弟' if options.n else '姐妹', "比":'姐妹' if options.n else '兄弟',
"食":'女儿' if options.n else '下属', "伤":'儿子' if options.n else '孙女'})
# 六亲分析
for item in Gan:
print("{}:{} {}-{} {} {} {}".format(item, ten_deities[me][item], liuqins[ten_deities[me][item]], ten_deities[item][zhis[0]] ,ten_deities[item][zhis[1]], ten_deities[item][zhis[2]], ten_deities[item][zhis[3]]), end=' ')
if Gan.index(item) == 4:
print()
print()
print()
# 计算上运时间,有年份时才适用
temps_scores = temps[gans.year] + temps[gans.month] + temps[me] + temps[gans.time] + temps[zhis.year] + temps[zhis.month]*2 + temps[zhis.day] + temps[zhis.time]
print("\033[1;36;40m五行分数", scores, ' 八字强弱:', strong, "通常>29为强,需要参考月份、坐支等", "weak:", weak)
gongs = get_gong(zhis)
zhis_g = set(zhis) | set(gongs)
jus = []
for item in zhi_hes:
if set(item).issubset(zhis_g):
print("三合局", item)
jus.append(ju[ten_deities[me].inverse[zhi_hes[item]]])
for item in zhi_huis:
if set(item).issubset(zhis_g):
print("三会局", item)
jus.append(ju[ten_deities[me].inverse[zhi_huis[item]]])
print("湿度分数", temps_scores,"正为暖燥,负为寒湿,正常区间[-6,6] 拱:", get_gong(zhis), "\033[0m")
for item in gan_scores:
print("{}[{}]-{} ".format(
item, ten_deities[me][item], gan_scores[item]), end=' ')
print()
print("-"*120)
yinyangs(zhis)
shen_zhus = list(zip(gan_shens, zhi_shens))
# 地网
if '辰' in zhis and '巳' in zhis:
print("地网:地支辰巳。天罗:戌亥。天罗地网全凶。")
# 天罗
if '戌' in zhis and '亥' in zhis:
print("天罗:戌亥。地网:地支辰巳。天罗地网全凶。")
# 魁罡格
if zhus[2] in (('庚','辰'), ('庚','戌'),('壬','辰'), ('戊','戌'),):
print("魁罡格:基础96,日主庚辰,庚戌,壬辰, 戊戌,重叠方有力。日主强,无刑冲佳。")
print("魁罡四柱曰多同,贵气朝来在此中,日主独逢冲克重,财官显露祸无穷。魁罡重叠是贵人,天元健旺喜临身,财官一见生灾祸,刑煞俱全定苦辛。")
# 金神格
if zhus[3] in (('乙','丑'), ('己','巳'),('癸','酉')):
print("金神格:基础97,时柱乙丑、己巳、癸酉。只有甲和己日,甲日为主,甲子、甲辰最突出。月支通金火2局为佳命。不通可以选其他格")
# 六阴朝阳
if me == '辛' and zhis.time == '子':
print("六阴朝阳格:基础98,辛日时辰为子。")
# 六乙鼠贵
if me == '乙' and zhis.time == '子':
print("六阴朝阳格:基础99,乙日时辰为子。忌讳午冲,丑合。月支最好通木局,水也可以,不适合金火。申酉大运有凶,午也不行。夏季为伤官。入其他格以格局论。")
# 从格
if max(scores.values()) > 25:
print("有五行大于25分,需要考虑专格或者从格。")
print("从旺格:安居远害、退身避位、淡泊名利,基础94;从势格:日主无根。")
if zhi_6he[3]:
if abs(Gan.index(gans[3]) - Gan.index(gans[2])) == 1:
print("日时干邻支合:连珠得合:妻贤子佳,与事业无关。母法总则P21-11")
for i,item in enumerate(zhis):
if item == me_ku:
if gan_shens[i] in ('才','财'):
print("财坐劫库,大破败。母法P61-4 戊寅 丙辰 壬辰 庚子")
#print(zhi_6chong[3], gans, me)
if zhi_6chong[3] and gans[3] == me:
print("日时天比地冲:女为家庭辛劳,男艺术宗教。 母法P61-5 己丑 丙寅 甲辰 甲戌")
#print(zhi_6chong[3], gans, me)
if zhi_xing[3] and gan_ke(me, gans[3]):
print("日时天克地刑:破败祖业、自立发展、后无终局。 母法P61-7 己丑 丙寅 甲午 庚午")
if (cai,yin_lu) in zhus and (cai not in zhi_shens2):
print("浮财坐印禄:破祖之后,自己也败。 母法P78-29 辛丑 丁酉 壬寅 庚子")
for i in range(3):
if is_yang():
break
if zhi_xing[i] and zhi_xing[i+1] and gan_ke(gans[i], gans[i+1]):
print("阴日主天克地刑:孤独、双妻。 母法P61-7 己丑 丙寅 甲午 庚午")
# 建禄格
if zhi_shens[1] == '比':
all_ges.append('建')
print("建禄格:最好天干有财官。如果官杀不成格,有兄弟,且任性。有争财和理财的双重性格。如果创业独自搞比较好,如果合伙有完善的财务制度也可以。")
if gan_shens[0] in '比劫':
print("\t建禄年透比劫凶")
elif '财' in gan_shens and '官' in gan_shens:
print("\t建禄财官双透,吉")
if me in ('甲','乙'):
print("\t甲乙建禄四柱劫财多,无祖财,克妻,一生不聚财,做事虚诈,为人大模大样,不踏实。乙财官多可为吉。甲壬申时佳;乙辛巳时佳;")
if me in ('丙'):
print("\t丙:己亥时辰佳;")
if me in ('丁'):
print("\t丁:阴男克1妻,阳男克3妻。财官多可为吉。庚子时辰佳;")
if me in ('戊'):
print("\t戊:四柱无财克妻,无祖业,后代多事端。如合申子辰,子息晚,有2子。甲寅时辰佳;")
if me in ('己'):
print("\t己:即使官财出干成格,妻也晚。偏财、杀印成格为佳。乙丑时辰佳;")
if me in ('庚'):
print("\t庚:上半月生难有祖财,下半月较好,财格比官杀要好。丙戌时辰佳;")
if me in ('辛'):
print("\t辛:干透劫财,妻迟财少;丁酉时辰佳;")
if me in ('壬'):
print("\t 壬:戊申时辰佳;")
if me in ('癸'):
print("\t 癸:己亥时辰佳")
# 甲分析
if me == '甲':
if zhis.count('辰') > 1 or zhis.count('戌') > 1:
print("甲日:辰或戌多、性能急躁不能忍。")
if zhis[2] == '子':
print("甲子:调候要火。")
if zhis[2] == '寅':
print("甲寅:有主见之人,需要财官旺支。")
if zhis[2] == '辰':
print("甲辰:印库、性柔和而有实权。")
if zhis[2] == '午':
print("甲午:一生有财、调候要水。")
if zhis[2] == '戌':
print("甲戌:自坐伤官,不易生财,为人仁善。")
if me in ('庚', '辛') and zhis[1] == '子' and zhis.count('子') >1:
print("冬金子月,再有一子字,孤克。 母法P28-106 甲戌 丙子 庚子 丁丑")
# 比肩分析
if '比' in gan_shens:
print("比:同性相斥。讨厌自己。老是想之前有没有搞错。没有持久性,最多跟你三五年。 散财,月上比肩,做事没有定性,不看重钱,感情不持久。不怀疑人家,人心很好。善意好心惹麻烦。年上问题不大。")
if gan_shens[0] == '比' and gan_shens[1] == '比':
print("比肩年月天干并现:不是老大,出身平常。女仪容端庄,有自己的思想;不重视钱财,话多不能守秘。30随以前是非小人不断。")
if gan_shens[1] == '比' and '比' in zhi_shen3[1]:
print("月柱干支比肩:争夫感情丰富。30岁以前钱不够花。")
if gan_shens[0] == '比':
print("年干比:上面有哥或姐,出身一般。")
if zhi_shens[2] == '比':
print("基52女坐比透比:夫妻互恨 丙辰 辛卯 辛酉 甲午。")
if gan_shens.count('比') > 1:
print("""----基51:天干2比
自我排斥,易后悔、举棋不定、匆促决定而有失;男倾向于群力,自己决策容易孤注一掷,小事谨慎,大事决定后不再重复考虑。
女有自己的思想、容貌佳,注意细节,喜欢小孩重过丈夫。轻视老公。对丈夫多疑心,容易吃醋冲动。
男不得女欢心.
难以保守秘密,不适合多言;
地支有根,一生小是非不断。没官杀制,无耐心。 END""")
# 比肩过多
if shens2.count('比') > 2 and '比' in zhi_shens:
#print(shens2, zhi_shens2)
print('''----比肩过多基51:
女的爱子女超过丈夫;轻易否定丈夫。 换一种说法:有理想、自信、贪财、不惧内。男的双妻。
兄弟之间缺乏帮助。夫妻有时不太和谐。好友知交相处不会很久。
即使成好格局,也是劳累命,事必躬亲。除非有官杀制服。感情烦心。
基53:善意多言,引无畏之争;难以保守秘密,不适合多言;易犯无事忙的自我表现;不好意思拒绝他人;累积情绪而突然放弃。
比肩过多,女:你有帮夫运,多协助他的事业,多提意见,偶尔有争执,问题也不大。女:感情啰嗦
对人警惕性低,乐天知命;情感过程多有波折
''')
if (not '官' in shens) and (not '杀' in shens):
print("基51: 比肩多,四柱无正官七杀,性情急躁。")
if '劫' in gan_shens:
print("天干比劫并立,比肩地支专位,女命感情丰富,多遇争夫。基52")
if gan_shens[0] == '比':
print("年干为比,不是长子,父母缘较薄,晚婚。")
if gan_shens[3] == '比':
print("母法总则P21-6:时干为比,如日时地支冲,男的对妻子不利,女的为夫辛劳,九流艺术、宗教则关系不大。")
if gan_shens[1] == '比':
if zhi_shens[1] == '食':
print("月柱比坐食,易得贵人相助。")
if zhi_shens[1] == '伤':
print("月柱比坐伤,一生只有小财气,难富贵。")
if zhi_shens[1] == '比':
print("月柱比坐比,单亲家庭,一婚不能到头。地支三合或三会比,天干2比也如此。")
if zhi_shens[1] == '财':
print("月柱比坐财,不利妻,也主父母身体不佳。因亲友、人情等招财物的无谓损失。")
if zhi_shens[1] == '杀':
print("月柱比坐杀,稳重。")
for seq, gan_ in enumerate(gan_shens):
if gan_ != '比':
continue
if zhis[seq] in empties[zhus[2]]:
print("基51:比肩坐空亡,不利父亲与妻。年不利父,月不利父和妻,在时则没有关系。甲戌 丙寅 甲子 己巳\n\t基52女:夫妻缘分偏薄,在年只是不利父,在月30岁以前夫妻缘薄 E")
if zhi_shens[seq] == '比':
print("比坐比-平吉:与官杀对立,无主权。养子:克偏财,泄正印。吉:为朋友尽力;凶:受兄弟朋友拖累。父缘分薄,自我孤僻,男多迟婚")
if zhi_shens[seq] == '劫':
print("女比肩坐劫:夫妻互恨,基52丁丑 壬子 壬戌 壬寅。\n\t还有刑冲且为羊刃,女恐有不测之灾:比如车祸、开刀和意外等。基52丙午 庚子 丙戌 丙申")
print("比坐劫-大凶:为忌亲友受损,合作事业中途解散,与妻子不合。如年月3见比,父缘薄或已死别。")
if ten_deities[gans[seq]][zhis[seq]] == '绝' and seq < 2:
print("比肩坐绝,兄弟不多,或者很难谋面。戊己和壬癸的准确率偏低些。")
if zhi_shens[seq] == '财':
print("比肩坐财:因亲人、人情等原因引起无谓损失。")
if zhi_shens[seq] == '杀':
print("比肩坐杀:稳重。")
if zhi_shens[seq] == '枭':
print("比肩坐偏印:三五年发达,后面守成。")
if zhi_shens[seq] == '劫' and Gan.index(me) % 2 == 0:
print("比肩坐阳刃:父亲先亡,基于在哪柱判断时间。基51:丙午 丙申 丙申 丁酉。E在年不利父,在其他有刀伤、车祸、意外灾害。\t基52女命年克父亲,月若30岁以前结婚不利婚姻")
if zhi_shens[seq] in ('劫','比') and'劫' in gan_shens:
print("天干比劫并立,比肩又坐比劫,女多遇争夫,个性强,不易协调。")
if zhi_xing[seq]:
print("比肩坐刑(注意不是半刑),幼年艰苦,白手自立长。 甲申 己巳 甲寅 庚午 基51")
if zhi_shens[seq] == '劫':
print("比肩坐刑劫,兄弟不合、也可能与妻子分居。")
if zhi_6chong[seq]:
print("比肩冲,手足不和,基于柱定时间 甲申 己巳 甲寅 庚午 基51。女命忌讳比劫和合官杀,多为任性引发困难之事。")
if zhi_shens[2] == '比':
print("日支比:1-39对家务事有家长式领导;钱来得不容易且有时有小损财。e 自我,如有刑冲,不喜归家!")
if zhi_shens[3] == '比':
print("时支比:子女为人公正倔强、行动力强,能得资产。")
if '比' in (gan_shens[1],zhi_shens[1]):
print("月柱比:三十岁以前难有成就。冒进、不稳定。女友不持久、大男子主义。")
if '比' in (gan_shens[3],zhi_shens[3]):
print("时柱比:与亲人意见不合。")
if shens.count('比') + shens.count('劫') > 1:
print("比劫大于2,男:感情阻碍、事业起伏不定。")
# 日坐禄
if me_lu == zhis[2]:
if zhis.count(me_lu) > 1:
if yin_lu in zhis:
if '比' in gan_shens or '劫' in gan_shens:
print("双禄带比印(专旺)、孤克之命。比论孤,劫论凶。母法总则P20-3。比禄印劫不可合见四位")
if zhi_6he[2] and '比' in gan_shens:
if yin_lu in zhis:
print("透比,坐禄六合,有印专旺:官非、残疾。六合近似劫财,如地支会印,法死。 母法总则P20-4")
print("透比,坐禄六合,如地支会印,法死。 母法总则P20-4")
if (zhi_xing[3] and gan_he[3] and gan_shens[3] == '财') or (zhi_xing[2] and gan_he[2] and zhi_xing[1] and gan_he[1] and gan_shens[1] == '财'):
print("日禄与正财干合支刑:克妻子,即便是吉命,也无天伦之乐。 母法总则P22-21")
if zhis.count(me_lu) > 2:
print("禄有三,孤。 母法总则P23-36")
if zhis[3] == me_ku:
if '财' in gan_shens or '才' in gan_shens:
print("时支日库,透财:清高、艺术九流。 母法总则P59-5 己未 辛未 丁巳 庚戌 P61-8 丁未 壬寅 癸卯 丙辰")
if piancai_lu == zhis[2]:
print("时支日库,坐偏财:吉祥近贵,但亲属淡薄。 母法总则P59-6 辛未 辛卯 丁酉 庚戌")
# 时坐禄
if me_lu == zhis[3]:
if '伤' in gan_shens and '伤' in zhi_shens2:
print("时禄,伤官格,晚年吉。 母法总则P56-26 己未 丙寅 乙丑 己卯")
if '杀' == gan_shens[3]:
print("杀坐时禄:为人反复不定。 母法总则P56-28 己未 丙寅 乙丑 己卯")
# 自坐劫库
if zhis[2] == me_ku:
if gan_shens[3] == '杀' and '杀' in zhi_shen3[3]:
print("自坐劫库,时杀格,贵!母法总则P30-143 辛未 辛卯 壬辰 戊申 母法总则P55-14 P60-22")
if gan_shens[3] == '官' and '官' in zhi_shen3[3]:
print("自坐劫库,正官格,孤贵!母法总则P56-24 辛未 辛卯 壬辰 戊申 母法总则P55-14")
if zhi_ku(zhis[3], (cai,piancai)):
print("自坐劫库,时财库,另有刃禄孤刑艺术,无者辛劳!母法总则P30-149 母法总则P56-17 56-18")
if gan_shens[3] == '财' and '财' in zhi_shen3[3]:
print("自坐劫库,时正财格,双妻,丧妻。 母法总则P55-13 己酉 戊寅 壬辰 丁未 P61-6 乙酉 戊寅 壬辰 丁未")
if (yin, me_lu) in zhus:
print("自坐劫库,即便吉,也会猝亡 母法总则P61-9 丁丑 甲辰 壬辰 辛亥")
# 劫财分析
if '劫' in gan_shens:
print("劫财扶助,无微不至。劫财多者谦虚之中带有傲气。凡事先理情,而后情理。先细节后全局。性刚强、精明干练、女命不适合干透支藏。")
print("务实,不喜欢抽象性的空谈。不容易认错,比较倔。有理想,但是不够灵活。不怕闲言闲语干扰。不顾及别人面子。")
print("合作事业有始无终。太重细节。做小领导还是可以的。有志向,自信。杀或食透干可解所有负面。女命忌讳比劫和合官杀,多为任性引发困难之事。")
if gan_shens[0] == '劫' and gan_shens[1] == '劫':
print("劫年月天干并现:喜怒形于色,30岁以前大失败一次。过度自信,精明反被精明误。")
if gan_shens[1] == '劫':
if '劫' in zhi_shen3[1]:
print("月柱干支劫:与父亲无缘,30岁以前任性,早婚防分手,自我精神压力极其重。")
if zhis[1] == cai_lu and zhis.count(yin_lu) > 1:
print("月干劫:月支财禄,如地支2旺印,旺财不敌,官非、刑名意外。")
if shens2.count('劫') > 2:
print('----劫财过多, 婚姻不好')
if zhi_shens[2] == '劫':
print("日坐劫财,透天干。在年父早亡,在月夫妻关系不好。比如财产互相防范;鄙视对方;自己决定,哪怕对方不同意;老夫少妻;身世有差距;斤斤计较;敢爱敢恨的后遗症\n\t以上多针对女。男的一般有双妻。天干有杀或食可解。基54丁未 己酉 丙午 己丑")
if zhus[2] in (('壬','子'),('丙','午'), ('戊','午')):
print("日主专位劫财,壬子和丙午,晚婚。不透天干,一般是眼光高、独立性强。对配偶不利,互相轻视;若刑冲,做事立场不明遭嫉妒,但不会有大灾。女性婚后通常还有自己的事业,能办事。")
if ('劫','伤') in shen_zhus or ('伤','劫',) in shen_zhus:
print("同一柱中,劫财、阳刃伤官都有,外表华美,富屋穷人,婚姻不稳定,富而不久;年柱不利家长,月柱不利婚姻,时柱不利子女。伤官的狂妄。基55丙申 丁酉 甲子 丁卯")
if gan_shens[0] == '劫':
print("年干劫财:家运不济。克父,如果坐劫财,通常少年失父;反之要看地支劫财根在哪一柱子。")
if '劫' in (gan_shens[1],zhi_shens[1]):
print("月柱劫:容易孤注一掷,30岁以前难稳定。男早婚不利。")
if '劫' in (gan_shens[3],zhi_shens[3]):
print("时柱劫:只要不是去经济大权还好。")
if zhi_shens[2] == '劫':
print("日支劫:男的克妻,一说是家庭有纠纷,对外尚无重大损失。如再透月或时天干,有严重内忧外患。")
if '劫' in shens2 and '比' in zhi_shens and '印' in shens2 and not_yang():
print("阴干比劫印齐全,单身,可入道!")
if zhi_shens[0] == '劫' and is_yang():
print("年阳刃:得不到长辈福;不知足、施恩反怨。")
if zhi_shens[3] == '劫' and is_yang():
print("时阳刃:与妻子不和,晚无结果,四柱再有比刃,有疾病与外灾。")
# 阳刃格
if zhi_shens[1] == '劫' and is_yang():
all_ges.append('刃')
print("阳刃格:喜七杀或三四个官。基础90 甲戊庚逢冲多祸,壬丙逢冲还好。")
if me in ('庚', '壬','戊'):
print("阳刃'庚', '壬','午'忌讳正财运。庚逢辛酉凶,丁酉吉,庚辰和丁酉六合不凶。壬逢壬子凶,戊子吉;壬午和戊子换禄不凶。")
else:
print("阳刃'甲', '丙',忌讳杀运,正财偏财财库运还好。甲:乙卯凶,辛卯吉;甲申与丁卯暗合吉。丙:丙午凶,壬午吉。丙子和壬午换禄不凶。")
if zhis.count(yin_lu) > 0 and gan_shens[1] == '劫': # 母法总则P20-1
print("阳刃格月干为劫:如果印禄位有2个,过旺,凶灾。不透劫财,有一印禄,食伤泄,仍然可以吉。 母法总则P20-1")
if gan_shens[3] == '枭' and '枭' in zhi_shen3[3]:
print("阳刃格:时柱成偏印格,贫、夭、带疾。 母法总则P28-107 癸未 辛酉 庚寅 戊寅")
if zhi_shens.count('劫') > 1 and Gan.index(me) % 2 == 0:
if zhis.day == yin_lu:
print("双阳刃,自坐印专位:刑妻、妨子。凶终、官非、意外灾害。母法总则P21-13")
if zhi_shens[1:].count('劫') > 0 and Gan.index(me) % 2 == 0:
if zhis.day == yin_lu and ('劫' in gan_shens or '比' in gan_shens):
print("阳刃,自坐印专位,透比或劫:刑妻。母法总则P36-8 己酉 丁卯 甲子 乙亥")
if zhis[2] in (me_lu,me_di) and zhis[3] in (me_lu,me_di):
print("日时禄刃全,如没有官杀制,刑伤父母,妨碍妻子。母法总则P30-151 丁酉 癸卯 壬子 辛亥 母法总则P31-153 ")
#print(gan_shens)
for seq, gan_ in enumerate(gan_shens):
if gan_ != '劫':
continue
if zhis[seq] in (cai_lu, piancai_lu):
print("劫财坐财禄,如逢冲,大凶。先冲后合和稍缓解!母法总则P21-7 书上实例不准!")
if zhi_shens[seq] == '财' and zhi_6he[seq]:
print("劫财坐六合财支:久疾暗病!母法总则P28-113 乙未 丙戌 辛亥 庚寅!")
if gan_shens[1] == '劫' and zhis[1] in (cai_lu, piancai_lu) and zhis.count(yin_lu) > 1 and '劫' in gan_shens:
print("月干劫坐财禄,有2印禄,劫透,财旺也败:官非、刑名、意外灾害! 母法总则P20-2")
# 自坐阳刃
if '劫' in zhi_shen3[2] and is_yang() and zhis[2] in zhengs:
if zhis[3] in (cai_lu, piancai_lu):
print("坐阳刃,时支财禄,吉祥但是妻子性格不受管制!母法总则P30-137 丁未 庚戌 壬子 乙巳")
if zhi_ku(zhis[3], (cai, piancai)):
print("坐阳刃,时支财库,名利时进时退!母法总则P30-148 丙寅 壬寅 壬子 庚戌")
if gan_shens[3] == '杀' and '杀' in zhi_shen3[3]:
print("坐阳刃,时杀格,贵人提携而富贵!母法总则P30-143 甲戌 丙寅 壬子 戊申")
# 偏印分析
if '枭' in gan_shens:
print("----偏印在天干如成格:偏印在前,偏财(财次之)在后,有天月德就是佳命(偏印格在日时,不在月透天干也麻烦)。忌讳倒食,但是坐绝没有这能力。")
print("经典认为:偏印不能扶身,要身旺;偏印见官杀未必是福;喜伤官,喜财;忌日主无根; 女顾兄弟姐妹;男六亲似冰")
print("偏印格干支有冲、合、刑,地支是偏印的绝位也不佳。")
#print(zhi_shen3)
if (gan_shens[1] == '枭' and '枭' in zhi_shen3[1]):
print("枭月重叠:福薄慧多,青年孤独,有文艺宗教倾向。")
if '枭' in zhi_shens2:
print("成格基础89生财、配印;最喜偏财同时成格,偏印在前,偏财在后。最忌讳日时坐实比劫刃。")
all_ges.append('枭')
if shens2.count('枭') > 2:
print("偏印过多,性格孤僻,表达太含蓄,要别人猜,说话有时带刺。偏悲观。有偏财和天月德贵人可以改善。有艺术天赋。做事大多有始无终。如四柱全阴,女性声誉不佳。")
print("对兄弟姐妹不错。男的因才干受子女尊敬。女的偏印多,子女不多。第1克伤食,第2艺术性。")
if '伤' in gan_shens:
print("女命偏印多,又与伤官同透,夫离子散。有偏财和天月德贵人可以改善。")
if gan_shens.count('枭') > 1:
print("天干两个偏印:迟婚,独身等,婚姻不好。三偏印,家族人口少,亲属不多建。基56甲午 甲戌 丙午 丙申")
if shen_zhus[0] == ('枭', '枭'):
print("偏印在年,干支俱透,不利于长辈。偏母当令,正母无权,可能是领养,庶出、同父异母等。 基56乙卯 甲申 丁丑 丁未")
for seq, zhi_ in enumerate(zhi_shens):
if zhi_ != '枭' and gan_shens[seq] != '枭':
continue
if ten_deities[gans[seq]][zhis[seq]] == '绝':
print("偏印坐绝,或者天干坐偏印为绝,难以得志。费力不讨好。基56辛酉 辛卯 丁巳 甲辰 丁卯 丁未 己丑 丁卯")
if zhi_shens[3] == '枭' and gan_shens[0] == '枭':
print("偏印透年干-时支,一直受家里影响。")
if '枭' in (gan_shens[0],zhi_shens[0]):
print("偏印在年:少有富贵家庭;有宗教素养,不喜享乐,第六感强。")
if '枭' in (gan_shens[1],zhi_shens[1]):
print("偏印在月:有慧少福,能舍己为人。")
if zhi_shens[1] == '枭' and zhis[1] in "子午卯酉":
print("偏印专位在月支:比较适合音乐,艺术,宗教等。子午卯酉。22-30之间职业定型。基56:壬午 癸卯 丁丑 丁未")
if gan_shens[1] == '枭':
print("干支偏印月柱,专位入格,有慧福浅,不争名利。基57:戊子 辛酉 癸未 丁巳")
if '枭' in (gan_shens[3],zhi_shens[3]):
print("偏印在时:女与后代分居;男50以前奠定基础,晚年享清福。")
if zhi_shens[2] == '枭' or zhis.day == xiao_lu:
print("偏印在日支:家庭生活沉闷")
if zhi_6chong[2] or zhi_xing[2]:
print("偏印在日支(专位?),有冲刑:孤独。基57:甲午 癸酉 丁卯 丁未 母法总则P55-5: 辛丑 辛卯 癸酉 戊午 P77-13")