0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Posted at

ごくありふれたおみくじを加工してみました。
よろしかったら、参考にどうぞ。
イメージファイル(参考)ase.jpg
chuukichi.png
daikichi.png
kyou.jpg
OIP_1_1.jpg
OIP_1_2.jpg
OIP_1_3.jpg
OIP_1_4.jpg
oip_1_5.jpg
OIP_1_6.jpg
OIP0.jpg
OIP1.jpg
OIP2.jpg
OIP3.jpg
omikuji.png
suekichi.png
syoukiti.png
script

#!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()


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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?