Python でおみくじ作ってみた。参考資料

ごくありふれたおみくじを加工してみました。
よろしかったら、参考にどうぞ。
イメージファイル(参考)![ase.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/822d5e33-d889-5f87-2847-7407a4cda2cb.jpeg)
![chuukichi.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/95fe6d77-e622-af27-ee26-4a0548d7a422.png)
![daikichi.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/a445074e-edd1-64a4-112e-4f03c38c0adc.png)
![kyou.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/78bef625-9d7b-d403-c337-39f87e55aa85.jpeg)
![OIP_1_1.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/7297443b-0990-9b32-2d74-58f179298c5c.jpeg)
![OIP_1_2.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/87192685-1156-8e39-9ba9-0c7b0d8f2def.jpeg)
![OIP_1_3.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/60fee94b-22ee-8327-2b74-adabfea607bd.jpeg)
![OIP_1_4.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/80da4e3b-de1f-2190-d69b-9fa0299baeef.jpeg)
![oip_1_5.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/60e5a70a-4561-8b44-9922-1bef239e8feb.jpeg)
![OIP_1_6.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/385eb7e1-1f35-570f-db58-932f65e84542.jpeg)
![OIP0.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/ba178ac3-8ca1-d75d-3691-2298142d55cd.jpeg)
![OIP1.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/e5d86d6b-370d-72b8-d918-0dd53e53566f.jpeg)
![OIP2.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/a1af27bd-f6cf-6bc9-3b8f-c8f49e372362.jpeg)
![OIP3.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/ccb73849-deb1-1997-1226-50734bc3e276.jpeg)
![omikuji.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/563557e4-6a98-8824-44da-145b93a94a0e.png)
![suekichi.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/834f30a5-0716-1185-c89c-d7d38a811ca6.png)
![syoukiti.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3625232/49d7c049-52ff-57ac-977c-dc602cf61e34.png)
script
```python
#!C:/Anaconda/python -X utf8
# coding=utf-8
############################################################################
# ver_1.01 Access http://127.0.0.1/my_python/omikuji/python_omikuji.cgi
#
#            ⛩　おみくじ　⛩
#           2023/12/17 改造開始
# This program is:python_omikuji.cgi                     -tattyan-
############################################################################
#    神社 祈祷・プログラムがうまくいきますように。。。　拝礼、合掌、拝礼。100yen.
import os
import sys
import cgi
import re
import datetime
import random

point_err = bool(1)
point_return = bool(0)
settig_msgA = 'NO Settig.'
settig_msgB = 'NO Settig.'
error_detail = 'No Error.'
def my_error(error_detail):
    if point_err:
        print ("Content-type:text/html\n\n")
        print ('<!DOCTYPE html><html lang=\"ja\"><head><meta charset=\"UTF-8\"><title>omikuji Error</title></head><body>')
    print ('<h1>エラー発生(An error has occurred.)</h1><h2>detail :'+error_detail+'</h2><div style=\"background-color: #000066;color: #cccccc;font-size: 12px;margin: 3px;padding: 3px;\">'+settig_msgA+'</div><div style=\"background-color: #006600;color: #cccccc;font-size: 12px;margin: 3px;padding: 3px;\">'+settig_msgB+'</div><br>')
    if point_return:
        return
    print ('</body></html>\n')
    exit()
    
# my_error('オープン前エラー Occurrence before opening <b>test.</b>')

req_met = os.environ.get('REQUEST_METHOD')

if req_met == 'POST':
    for query in sys.stdin:
        os.environ.get('CONTENT_LENGTH')
        pass
else:
    query = os.environ.get('QUERY_STRING')
    if len(query) > 0 and req_met != 'POST':
        tmp_q_m = '<b>not post.</b>:'+str(len(query))+'<br>query:'+query
        #GET規制があったら
if len(query) > 10:
    language = str(len(query))
    #受信バイト規制ががあったら
tmp_q_m = '<b>not post.</b>:'+str(len(query))+'<br>query:'+query
settig_msgA = tmp_q_m+'<br>\n'
        #後で表示できるように変数に+=で貯め込んでいく。
    
    #print (f'largebyte: 10 {language}<br>\n') #test message after get out;F(x)Qestit??
buf_arrey = query.split("&")
# settig_msgB = (buf_arrey)
import urllib.parse
key0=''
value0=''
my_hash = {}
#my_hash = {'step': '0'}
my_hash['step']='0'
my_hash['x']='0'
my_hash['y']='0'
my_hash['sele0']=''
my_hash['sele']=''
my_hash['select']='center'
my_hash['pow']='50'
my_hash['try_cyans']='3'
my_hash['lucky']=''
key_myh = list(my_hash.keys())
#my_hash ハッシュ に入れる1個は設定しておく
if "" not in buf_arrey:
    for my_buf in buf_arrey:
        mytem_buf = my_buf
        mytem_buf += '='
        key_val_arry = mytem_buf.split("=")
        key0 = key_val_arry[0]
        value0 =key_val_arry[1]

        key0 = re.sub(r'%([0-9a-fA-F][0-9a-fA-F])', lambda x: chr(int(x.group(1), 16)), key0)
    #    key0 =  urllib.parse.unquote(key0)
        key0 = re.sub(r'\+', ' ', key0)
        key0 = re.sub(r'&', '&amp;', key0)
        key0 = re.sub(r'<', '&lt;', key0)
        key0 = re.sub(r'>', '&gt;', key0)
        key0 = re.sub(r'\r\n', '<br>', key0)
        key0 = re.sub(r'\r|\n', '<br>', key0)
        my_key = key0
        
        value0 = re.sub(r'%([0-9a-fA-F][0-9a-fA-F])', lambda x: chr(int(x.group(1), 16)), value0)
    #    value0 = urllib.parse.unquote(value0)
        value0 = re.sub(r'\+', ' ', value0)
        value0 = re.sub(r'&', '&amp;', value0)
        value0 = re.sub(r'<', '&lt;', value0)
        value0 = re.sub(r'>', '&gt;', value0)
        value0 = re.sub(r'\r\n', '<br>', value0)
        value0 = re.sub(r'\r|\n', '<br>', value0)
        my_val = value0
        key_c=0
        key_c=0
        for key_myh_s in key_myh:
            if key0 == key_myh_s:
                key_c=1

        if key_c==0:
            if "" is not my_val:
                my_val = ''
        try:
            my_hash[my_key] = my_val
        except:
            my_hash[my_key] = str(my_val)
# 受信終わり
settig_msgB = ''
test_key = list(my_hash.keys())
for test_key1 in test_key:
    try:
        settig_msgB += test_key1+':'+my_hash[test_key1]+'; '
    except:
        tmp_value_h = str(my_hash[test_key1])
        settig_msgB += test_key1+':'+tmp_value_h+'; '
        
tmp_h_step_n = int(my_hash['step'])
tmp_h_step_n +=1
my_hash['step'] = str(tmp_h_step_n)
        
print ('Content-type:text/html\n\n')
print ('<!DOCTYPE html><html lang="ja"><head><meta charset="UTF-8"><title>omikuji</title>')
print('<style type="text/css">\n')

print('<!--\n')
print('@charset "UTF-8";\n')
print('body {margin: 1cm;background: skyblue;}\n')
print('td {vertical-align: top;text-align: center;}\n')
print('-->\n')
print('</style>\n')
print('</head><body><h1>祈願。一発 !!　Prayer. One shot !!</h1>')

point_err = bool(0)
# エラーメッセージを表示できる領域に入ったら(0)として置く。
point_return = bool(1)
#　エラーメッセージ後表示を継続するために帰ってくる(1)再設定するまで有効。
# my_error('オープンエラーリターン open error return <b>test.</b>')

random_number = random.randint(0, 100)

pinch = bool(0)
int_try = int(my_hash['try_cyans'])
int_try -=1
if int_try < 0:
    pinch = bool(1)
my_hash['try_cyans'] = str(int_try)

str_ran_100 = str(random_number)







#settig_msgB = 'step='+my_hash['step']+';sel='+my_hash['sele']
#my_error('open error return <b>test.</b>')
if my_hash['step'] == '1':
    print('<div align="center"><table border=0 cellspacing=5><tr><td bgcolor="#ffffff">')
    print('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="s1">\n')
    print('健康祈願<br><font size="1">Prayer for health<br></font><input type="image" src="imge/OIP_1_1.jpg" width="110" alt="健康祈願"></form></td><td bgcolor="#ffffff">')
    print('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="s2">\n')
    print('学業祈願<br><font size="1">Prayer for academic studies<br></font><input type="image" src="imge/OIP_1_2.jpg" width="110" alt="学業祈願"></form></td><td bgcolor="#ffffff">')
    print('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="s3">\n')
    print('安全祈願<br><font size="1">Prayer for safety<br></font><input type="image" src="imge/OIP_1_3.jpg" width="110" alt="安全祈願"></form></td><td bgcolor="#ffffff">')
    print('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="s4">\n')
    print('恋愛成就<br><font size="1">love fulfillment<br></font><br><input type="image" src="imge/OIP_1_4.jpg" width="110" alt="恋愛成就"></form></td><td bgcolor="#ffffff">')
    print('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="s5">\n')
    print('商売繁盛<br><font size="1">Prosperous business<br></font><input type="image" src="imge/oip_1_5.jpg" width="110" alt="商売繁盛"></form></td><td bgcolor="#ffffff">')
    print('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="s6">\n')
    print('万願成就<br><font size="1">All wishes come true<br></font><input type="image" src="imge/OIP_1_6.jpg" width="110" alt="万願成就"></form></td></tr>')
    print('</table>')
    print ('<h1>願い事を念じながら、<br>アイコンをクリックしてください。</h1>Please click on the icon while thinking about your wish.<br>')
    
elif my_hash['step']=='2':
    fortunes = [0, 1, 2, 3, 4, 5]
    fortunes1 = ['<input type="image" src="imge/daikichi.png" width="330" alt="daikichi">', '<input type="image" src="imge/chuukichi.png" width="115" alt="cyukichi">', '<input type="image" src="imge/syoukiti.png" width="115" alt="syoukichi">', '<input type="image" src="imge/suekichi.png" width="115" alt="suekichi">', '<input type="image" src="imge/kyou.jpg" width="150" alt="kyou">', '<input type="image" src="imge/omikuji.png" width="300" alt="once again">']
    fortunes2 = ['good lacky!!', 'lacky!','good day!','nevre day','Caution is required.','once again<img src="imge/ase.png" width="50" alt="ase">']    
    fortune = random.choice(fortunes)    
    if fortune == 5:
        stp_int = int(my_hash['step'])
        stp_int -=1
        my_hash['step'] = str(stp_int)
    print ('<div align="center"><table border=0 cellspacing=10>\n')
    print('<tr><td align="center">')
    if fortune < 5:
        print ('成就祈願<br><font size="1">Prayer for fulfillment<br></font><form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele" value="left">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('<input type="image" src="imge/OIP0.jpg" width="150" alt="祈願"></form></td><td align="center">')    
    print ('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print(fortunes1[fortune]+'<br><h2>'+fortunes2[fortune]+'</h2>\n')
    #print('<input type=\"hidden\" name=\"hidden_data\" value=\"this_is_a_hidden_value.\">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    if fortune == 5:
        print('<input type="hidden" name="sele" value="">\n')
    else:
        print('<input type="hidden" name="sele" value="sentr">\n')
    print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
    print ('</form>')
    if fortune < 5:
        print ('</td><td align="center">厄除開運<br><font size="1">Good luck warding off evil spirits<br></font><form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele" value="rite">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('<input type="image" src="imge/OIP1.jpg" width="150" alt="開運"></form>\n')
    print('</td></tr></table></div><br>\n')
elif my_hash['step']=='3' and my_hash['sele'] == 'sentr':
    print('<h1 align="center"><font color="#ff0000">Do you get unlucky power?</h1>')
    print('<h2 align="center">For reference, it\'s <b>'+str_ran_100+'%</b>. to be successful.</font><br>')
    print ('<div align="center">It doesn\'t tell you if it\'s a success or a failure.<br>Prayer is important!!<br><table border=0 cellspacing=10>\n')
    print('<tr><td align="center">成就祈願<br><font size="2">Prayer for fulfillment<br></font>')
    print ('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele" value="left">\n')
    print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
    print ('<input type="image" src="imge/OIP0.jpg" width="250" alt="祈願"></form>')
    print ('</td><td align="center">厄除開運<br><font size="2">Good luck warding off evil spirits<br></font>')
    print ('<form action="http://127.0.0.1/my_python/omikuji/python_omikuji.cgi" method="POST">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele" value="rite">\n')
    print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
    print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
    print ('<input type="image" src="imge/OIP1.jpg" width="250" alt="開運"></form>\n')
    print('</td></tr></table></div>\n')

elif not pinch:
    int_r_pow = int(str_ran_100)
    int_b_pow = int(my_hash['pow'])
    int_pow = int_r_pow + int_b_pow
    if int_pow > 100:
        int_pow -= 100
    str_ran_100 = str(int_pow)
    print ('<h1 align="center">Power'+str_ran_100+'% try_chance:'+my_hash['try_cyans']+'</h1>')
    if my_hash['sele']=='left':
        if my_hash['select'] == 'left' and int_pow > 60:
            print('<h2 align="center"><font color="#0000ff">No No No Next one!</font></h2>')
        print ('<div align="center"><h2>Good things happen.</h2><br><table border=0 cellspacing=10>\n')
        print('<tr><td align="center">')
        print ('<form action=\"http://127.0.0.1/my_python/omikuji/python_omikuji.cgi\" method=\"POST\">\n')
        print ('<input type="hidden" name="lucky" value="Berry lucky">\n')
        print ('Satisfied with the results.<br><input type="image" src="imge/OIP3.jpg" width="250" alt="祈願1"><br>')
        print('<input type="hidden" name="try_cyans" value="'+my_hash['try_cyans']+'">\n')
        print('<input type="hidden" name="pow" value="'+str_ran_100+'">\n')
        print('<input type="hidden" name="sele" value="left">\n')
        print('<input type="hidden" name="select" value="left">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('</form></td><td>')
        print ('<form action=\"http://127.0.0.1/my_python/omikuji/python_omikuji.cgi\" method=\"POST\">\n')
        print ('<input type="hidden" name="lucky" value="Berry lucky">\n')  
        print ('Pray again.<br><input type="image" src="imge/OIP0.jpg" width="150" alt="祈願1"><br>')
        print('<input type="hidden" name="try_cyans" value="'+my_hash['try_cyans']+'">\n')
        print('<input type="hidden" name="pow" value="'+str_ran_100+'">\n')
        print('<input type="hidden" name="sele" value="left">\n')
        print('<input type="hidden" name="select" value="center">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('</form></td><td>')
        print ('<form action=\"http://127.0.0.1/my_python/omikuji/python_omikuji.cgi\" method=\"POST\">\n')
        print ('<input type="hidden" name="lucky" value="Berry lucky">\n')        
        print ('Finish worship.<br><input type="image" src="imge/OIP1.jpg" width="150" alt="祈願1"><br>')
        print('<input type="hidden" name="try_cyans" value="'+my_hash['try_cyans']+'">\n')
        print('<input type="hidden" name="pow" value="'+str_ran_100+'">\n')
        print('<input type="hidden" name="sele" value="left">\n')
        print('<input type="hidden" name="select" value="rite">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('</form>\n')
        print('</td></tr></table></div>\n')       
    else:
        if my_hash['select'] == 'left' and int_pow < 40:
            print('<h2 align="center"><font color="#0000ff">No No No Next one!</font></h2>')
        print('<div align="center"><h2>There will be bad luck.</h2><table border=0 cellspacing=10>\n')
        print('<tr><td align="center">')
        print ('<form action=\"http://127.0.0.1/my_python/omikuji/python_omikuji.cgi\" method=\"POST\">\n')      
        print ('Satisfied with the results.<br><input type="image" src="imge/OIP2.jpg" width="250" alt="祈願1"><br>')
        print ('<input type="hidden" name="lucky" value="Berry unlucky">\n')
        print('<input type="hidden" name="try_cyans" value="'+my_hash['try_cyans']+'">\n')
        print('<input type="hidden" name="pow" value="'+str_ran_100+'">\n')
        print('<input type="hidden" name="select" value="left">\n')
        print('<input type="hidden" name="sele" value="rite">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('</form></td><td>')
        print ('<form action=\"http://127.0.0.1/my_python/omikuji/python_omikuji.cgi\" method=\"POST\">\n')
        print ('<input type="hidden" name="lucky" value="Berry unlucky">\n')
        print ('Pray again.<br><input type="image" src="imge/OIP0.jpg" width="150" alt="祈願1"><br>')
        print('<input type="hidden" name="try_cyans" value="'+my_hash['try_cyans']+'">\n')
        print('<input type="hidden" name="pow" value="'+str_ran_100+'">\n')
        print('<input type="hidden" name="select" value="center">\n')
        print('<input type="hidden" name="sele" value="rite">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('</form></td><td>')
        print ('<form action=\"http://127.0.0.1/my_python/omikuji/python_omikuji.cgi\" method=\"POST\">\n')
        if not my_hash['try_cyans'] == '0' and int_pow < 50:        
            print ('Finish worship.<br><input type="image" src="imge/OIP1.jpg" width="150" alt="祈願1"><br>')
            print('<input type="hidden" name="try_cyans" value="'+my_hash['try_cyans']+'">\n')
        else:
            print ('to not give up.<br><input type="image" src="imge/OIP1.jpg" width="150" alt="祈願1"><br>')
            print('<input type="hidden" name="try_cyans" value="1">\n')
        print ('<input type="hidden" name="lucky" value="Berry unlucky">\n')
        print('<input type="hidden" name="pow" value="'+str_ran_100+'">\n')
        print('<input type="hidden" name="select" value="rite">\n')
        print('<input type="hidden" name="sele" value="rite">\n')
        print('<input type="hidden" name="step" value="'+my_hash['step']+'">\n')
        print('<input type="hidden" name="sele0" value="'+my_hash['sele0']+'">\n')
        print ('</form>\n')
        print('</td></tr></table></div>\n')       
else:
    print('<h1 align="center">Confirm!! you will get Power'+str_ran_100+'%.</h1>')
    print('<h1 align="center"><font color="#ff0000">'+my_hash['lucky']+' Get!!</font></h1>\n')
    fortunes = [0,1,2,3,4]
    fortunes1 = ['願えば訪れ願わなければ成ることはない。','大成には代償もつくものと思え。','良きこと多からず悪き事多からず。','子は要、百代の要、鬱陶う事なかれ。','一日一善、ご飯は3食。']
    fortunes2 = ['If you wish for it, it will come and if you don\'t wish for it, it will not come true.','I believe that great success comes with debt.','There are not many good things, and there are not many bad things.','A child is the key, a hundred generations are the key, don\'t get depressed.','One good meal a day, three meals a day.']
    fortune = random.choice(fortunes)

    int_ran_pw = int(str_ran_100)
    if int_ran_pw < 34:
        my_lucky = 'low'
    elif int_ran_pw < 67:
        my_lucky = 'normal'
    else:
        my_lucky = 'high'
        
    if my_hash['sele0'] == 's1' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'high':
        hantei = '成功success健康health'
    elif my_hash['sele0'] == 's1' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'normal':
        hantei = '普通usually健康health'   
    elif my_hash['sele0'] == 's1' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'low':
        hantei = '失敗failure健康health'
    elif my_hash['sele0'] == 's1' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'low':
        hantei = '成功success健康health'    
    elif my_hash['sele0'] == 's1' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'normal':
        hantei = '普通usually健康health'
    elif my_hash['sele0'] == 's1' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'high':
        hantei = '失敗failure健康health'
        
    if my_hash['sele0'] == 's2' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'high':
        hantei = '成功success学業schoolwork'
    elif my_hash['sele0'] == 's2' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'normal':
        hantei = '普通usually学業schoolwork'   
    elif my_hash['sele0'] == 's2' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'low':
        hantei = '失敗failure学業schoolwork'
    elif my_hash['sele0'] == 's2' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'low':
        hantei = '成功success学業schoolwork'    
    elif my_hash['sele0'] == 's2' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'normal':
        hantei = '普通usually学業schoolwork'
    elif my_hash['sele0'] == 's2' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'high':
        hantei = '失敗failure学業schoolwork'
        
    if my_hash['sele0'] == 's3' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'high':
        hantei = '成功success安全safety'
    elif my_hash['sele0'] == 's3' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'normal':
        hantei = '普通usually安全safety'   
    elif my_hash['sele0'] == 's3' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'low':
        hantei = '失敗failure安全safety'
    elif my_hash['sele0'] == 's3' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'low':
        hantei = '成功success安全safety'    
    elif my_hash['sele0'] == 's3' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'normal':
        hantei = '普通usually安全safety'
    elif my_hash['sele0'] == 's3' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'high':
        hantei = '失敗failure安全safety'
    
    if my_hash['sele0'] == 's4' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'high':
        hantei = '成功success恋愛love affair'
    elif my_hash['sele0'] == 's4' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'normal':
        hantei = '普通usually恋愛love affair'   
    elif my_hash['sele0'] == 's4' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'low':
        hantei = '失敗failure恋愛love affair'
    elif my_hash['sele0'] == 's4' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'low':
        hantei = '成功success恋愛love affair'    
    elif my_hash['sele0'] == 's4' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'normal':
        hantei = '普通usually恋愛love affair'
    elif my_hash['sele0'] == 's4' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'high':
        hantei = '失敗failure恋愛love affair'
        
    if my_hash['sele0'] == 's5' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'high':
        hantei = '成功success商売business'
    elif my_hash['sele0'] == 's5' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'normal':
        hantei = '普通usually商売business'   
    elif my_hash['sele0'] == 's5' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'low':
        hantei = '失敗failure商売business'
    elif my_hash['sele0'] == 's5' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'low':
        hantei = '成功success商売business'    
    elif my_hash['sele0'] == 's5' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'normal':
        hantei = '普通usually商売business'
    elif my_hash['sele0'] == 's5' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'high':
        hantei = '失敗failure商売business'
        
    if my_hash['sele0'] == 's6' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'high':
        hantei = '成功success全てall'
    elif my_hash['sele0'] == 's6' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'normal':
        hantei = '普通usually全てall'   
    elif my_hash['sele0'] == 's6' and my_hash['lucky'] == 'Berry lucky' and my_lucky == 'low':
        hantei = '失敗failure全てall'
    elif my_hash['sele0'] == 's6' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'low':
        hantei = '成功success全てall'    
    elif my_hash['sele0'] == 's6' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'normal':
        hantei = '普通usually全てall'
    elif my_hash['sele0'] == 's6' and my_hash['lucky'] == 'Berry unlucky' and my_lucky == 'high':
        hantei = '失敗failure全てall'

    print('<div align="center"><h2>'+hantei+' の部類に入ります。精進して事に当たれ。<br>It goes into '+hantei+' Work hard and get things done.</h2>\n')
    print('<h3>'+fortunes1[fortune]+'<br>'+fortunes2[fortune]+'</h3>\n')
    print('I hope for you. I hope you have a good day.</div>\n')
   
#センター　願えば訪れ願わなければ成ることはない。　大成には代償もつくものと思え。良きこと多からず悪き事多からず。 子は要、百代の要、鬱陶う事なかれ。  
    
print ('<br><br><a href="python_omikuji.cgi">NEW GEMU</a><br>\n')
print ('<br><a href="../python_html.html">index</a>\n')
print ('<br><font size="1">Copy and Paste Online English-Japanese Translation (Multilingal Online Translation) Sponsored by bingAI, Copilot</font>\n')
print ('</body></html>\n')

exit()


```
御利益を祈りながら事に当たるのが吉。
よろしくお願いいたします。