ボートレース予想練習アプリを作ってみた

スポンサーリンク

はじめに

PythonのTkinterの勉強がてらボートレースの予想練習アプリを作ってみました。

予想練習アプリというのは、過去のレースをランダムで表示して3連単のエア買いをし、予想の練習をするアプリです。

つまりボートレースの過去問のようなものです。

今回はPythonのソースコードを公開します。

動作の様子

期間と場の設定

ランダムで表示されるレースの期間と場を設定します。

設定したら、「設定完了!」→「次のレースへ」の順番にボタンを押します。

ボタンクリック時にはレースの検索で時間が掛かることがあります。

舟券の選択

レースの情報が表示されます。

エア買いをする時はオッズ表のチェックボックスをクリックしてベットリストリストに追加がされます。

追加後に舟券の枚数を右側で変更できます。

舟券の追加、枚数の変更などを行った場合は必ず「ベットリストを更新」ボタンを押すようにしてください。

エア買い

舟券が決まったら、「結果を表示」ボタンを押してエア買いをして、結果を確認します。

次のレースに進むときは、「次のレースへ」ボタンを押して進みます。

ソースコード

zipファイルとソースコードベタ書きの2通りで準備しました。

import tkinter as tk
import tkinter.ttk as ttk
from bs4 import BeautifulSoup
from urllib import request
from urllib.request import urlopen
import time
import numpy as np
import random

class create_app:

    jcd_name_list=['桐生','戸田','江戸川','平和島','多摩川','浜名湖','蒲郡','常滑','津','三国','びわこ','住之江','尼崎','鳴門','丸亀','児島','宮島','徳山','下関','若松','芦屋','福岡','唐津','大村']
    card_col_list=['枠番','選手名','級別','登録番号\n支部/出身地\n年齢/体重','F数\nL数\n平均ST','全国勝率\n2連率\n3連率','当地勝率\n2連率\n3連率','モーターNo\n2連率\n3連率','ボートNo\n2連率\n3連率']
    tenji_col_list=['枠番','選手名','展示タイム','チルト','進入','','ST展示']
    result_col_list=['着順','枠番','選手名','タイム','進入','']

    def __init__(self,master):
        self.master=master
        self.title='競艇予想練習'
        #初期値
        self.race_num=0
        self.profit_sum=0
        self.set_title()
        self.set_size()
        self.create_frame_day()
        self.create_frame_jcd()
        self.set_button()
        self.create_main_frame()
        #self.build_main_frame()

    def build_main_frame(self):
        self.create_main_frame()
        self.create_card()
        self.create_tenji()
        self.create_odds()
        self.create_bet_button()
        self.create_bet_list()
        self.set_result_button()
        self.create_result()
        self.create_return()

    def destroy_main_frame(self):
        self.frame_left.destroy()
        self.frame_center.destroy()
        self.frame_right.destroy()

    def set_title(self):
        self.master.title(self.title)

    def set_size(self,state='zoomed'):
        self.master.state(state)

    def create_frame_day(self):
        frame_day=tk.Frame(self.master)
        tk.Label(frame_day,text='期間(yyyymmdd形式):').pack(side='left',anchor='n')
        self.start_day=tk.Entry(frame_day)
        self.start_day.insert(tk.END,'20210101')
        self.start_day.pack(side='left',anchor='n')
        tk.Label(frame_day,text='から').pack(side='left',anchor='n')
        self.finish_day=tk.Entry(frame_day)
        self.finish_day.insert(tk.END,'20210609')
        self.finish_day.pack(side='left',anchor='n')
        tk.Label(frame_day,text='までの範囲でランダムに出題 ※20170309~昨日の範囲で入力').pack(side='left',anchor='n')
        frame_day.pack(expand=True)

    def create_frame_jcd(self):
        frame_jcd=tk.Frame(self.master)
        self.jcd_bool=[tk.BooleanVar() for i in range(len(self.jcd_name_list))]
        for i in range(24):
            tk.Checkbutton(frame_jcd,variable=self.jcd_bool[i],text=self.jcd_name_list[i]).pack(side='left')
        frame_jcd.pack(expand=True)

    def set_button(self):
        self.start_button=tk.Button(self.master,text=u'期間と会場の設定完了!',command=self.get_url)
        self.start_button.pack(expand=True)
        self.next_button=tk.Button(self.master,command=self.renew_page,text=u'次のレースへ')
        self.next_button.pack(expand=True)

    def renew_page(self):
        self.count_race_num()
        self.destroy_main_frame()
        self.build_main_frame()
        self.master.after(2000,self.get_url)

    def get_checked_jcd(self):
        self.checked_jcd_list=[]
        for i in range(1,25):
            if self.jcd_bool[i-1].get()==True:
                self.checked_jcd_list.append(i)

    def get_url_main_frame(self):
        self.get_url_card_info()
        self.get_url_tenji_info()
        self.get_url_odds_list()
        self.get_url_result()

    def get_url(self):
        self.get_random_race_id()
        self.get_url_main_frame()

    def get_random_race_id(self):
        self.get_checked_jcd()
        start_year=int(self.start_day.get()[:4])
        finish_year=int(self.finish_day.get()[:4])
        id_dicided=False
        d=0
        rno=0
        jcd=0
        while id_dicided==False:
            in_range=False
            while in_range==False:
                year=random.randint(start_year,finish_year)
                month=random.randint(1,12)
                day=random.randint(1,31)
                d=str(year)+str(month).zfill(2)+str(day).zfill(2)
                d=int(d)
                if int(self.start_day.get())<=d<=int(self.finish_day.get()):
                    in_range=True
            rno=random.randint(1,12)
            i=random.randint(0,len(self.checked_jcd_list)-1)
            jcd=self.checked_jcd_list[i]
            url='https://www.boatrace.jp/owpc/pc/race/resultlist?jcd='+str(jcd).zfill(2)+'&hd='+str(d)
            time.sleep(1)
            response=request.urlopen(url)
            soup=BeautifulSoup(response,'html.parser')
            response.close()

            result=soup.find_all('div',class_='numberSet1_row')
            try:
                result_len=len(result[rno*2-2].get_text().strip())
                remark=soup.find_all('td',class_='is-p10-7')
                try:
                    remark_len=len(remark[rno*3-1].get_text())
                    if result_len==5 and remark_len<=1:
                        id_dicided=True
                except IndexError:
                    pass
            except IndexError:
                pass
        self.jcd=str(jcd)
        self.race_day=str(d)
        self.race_rno=str(rno)
        print(self.race_day,self.race_rno)

    def create_main_frame(self):
        self.frame_left=tk.Frame(self.master)
        self.frame_left.pack(side='left',expand=True)
        self.frame_center=tk.Frame(self.master)
        self.frame_center.pack(side='left',expand=True)
        self.frame_right=tk.Frame(self.master)
        self.frame_right.pack(side='left',expand=True,anchor='n')
    
    def num_color(self,i):
        if i==1:
            bg='white'
            fg='black'
        elif i==2:
            bg='black'
            fg='white'
        elif i==3:
            bg='red'
            fg='white'
        elif i==4:
            bg='blue'
            fg='white'
        elif i==5:
            bg='yellow'
            fg='black'
        elif i==6:
            bg='green'
            fg='white'
        return {'bg':bg, 'fg':fg}

    def get_url_card_info(self):
        url='https://www.boatrace.jp/owpc/pc/race/racelist?rno='+self.race_rno+'&jcd='+self.jcd.zfill(2)+'&hd='+self.race_day
        time.sleep(1)
        response=request.urlopen(url)
        self.soup_card_info=BeautifulSoup(response,'html.parser')
        response.close()
       
    def get_card_info(self):
            soup=self.soup_card_info
            record=soup.find_all('td',class_='is-lineH2')
            record_list=list([0,0,0,0,0] for i in range(6))
            for i in range(1,7):
                for j in range(5):
                    record_list[i-1][j]=record[i*5-5+j].get_text().replace(' ','').strip().replace('\r','')

            name=soup.find_all('div',class_='is-fs18 is-fBold')
            name_list=[]
            for i in range(6):
                name_list.append(name[i].get_text().replace('\n',''))

            info=soup.find_all('div',class_='is-fs11')
            area_list=list([0,0,0,0,0,0])
            rank_list=list([0,0,0,0,0,0])
            no_list=list([0,0,0,0,0,0])
            for i in range(1,7):
                area_list[i-1]=info[i*2-1].get_text().replace(' ','').strip().replace('\r','')
                rankno=info[i*2-2].get_text().replace(' ','').strip()
                rankno=rankno.split('/')
                rank_list[i-1]=rankno[1]
                no_list[i-1]=rankno[0].replace('\r','')
                area_list[i-1]=no_list[i-1]+area_list[i-1]
                self.name_list=name_list
            return record_list,area_list,rank_list

    def create_card(self):
        tk.Label(self.frame_left,text=self.jcd_name_list[int(self.jcd)-1]+':'+self.race_day[:4]+'年'+self.race_day[4:6]+'月'+self.race_day[-2:]+'日',font=("MSゴシック", "20", "bold")).pack(anchor='w')

        frame_card=tk.Frame(self.frame_left)
        record_list,area_list,rank_list=self.get_card_info()
        for i in range(len(self.card_col_list)):
            tk.Label(frame_card,text=self.card_col_list[i]).grid(row=1,column=i,sticky='nsew')
        for i in range(1,7):
            tk.Label(frame_card,text=str(i),bg=self.num_color(i)['bg'],fg=self.num_color(i)['fg']).grid(row=i*2+1,column=0,sticky='nsew')
            tk.Label(frame_card,text=self.name_list[i-1]).grid(row=i*2+1,column=1)
            tk.Label(frame_card,text=rank_list[i-1]).grid(row=i*2+1,column=2)
            tk.Label(frame_card,text=area_list[i-1]).grid(row=i*2+1,column=3)
            for j in range(5):
                tk.Label(frame_card,text=record_list[i-1][j]).grid(row=i*2+1,column=j+4)
        for i in range(0,15,2):
            ttk.Separator(frame_card,orient='horizontal').grid(row=i,column=0,columnspan=9,sticky='ew')
        frame_card.pack()

    def get_url_tenji_info(self):
        url='https://www.boatrace.jp/owpc/pc/race/beforeinfo?rno='+self.race_rno+'&jcd='+self.jcd.zfill(2)+'&hd='+self.race_day
        time.sleep(1)
        response=request.urlopen(url)
        self.soup_tenji_info=BeautifulSoup(response,'html.parser')
        response.close()

    def get_tenji_info(self):
        soup=self.soup_tenji_info
        course=soup.find_all('span',class_=lambda value: value and value.startswith('table1_boatImage1Number'))
        course_list=list([course[i].get_text() for i in range(6)])

        st=soup.find_all('span',class_='table1_boatImage1Time')
        st_list=list([st[i].get_text() for i in range(6)])

        ftime=soup.find_all('td',rowspan='4')
        ftime_list=list([ftime[i].get_text() for i in range(3,39,7)])

        tilt=soup.find_all('td',rowspan='4')
        tilt_list=list([ftime[i].get_text() for i in range(4,40,7)])
        return course_list,st_list,ftime_list,tilt_list

    def create_tenji(self):
        frame_tenji=tk.Frame(self.frame_left)
        course_list,st_list,ftime_list,tilt_list=self.get_tenji_info()
        for i in range(len(self.tenji_col_list)):
            tk.Label(frame_tenji,text=self.tenji_col_list[i]).grid(row=1,column=i*2+1,sticky='nsew')
        for i in range(1,7):
            tk.Label(frame_tenji,text=str(i),bg=self.num_color(i)['bg'],fg=self.num_color(i)['fg']).grid(row=i*2+1,column=1,sticky='nsew')
            tk.Label(frame_tenji,text=self.name_list[i-1]).grid(row=i*2+1,column=3)
            tk.Label(frame_tenji,text=ftime_list[i-1]).grid(row=i*2+1,column=5)
            tk.Label(frame_tenji,text=tilt_list[i-1]).grid(row=i*2+1,column=7)
            course_num=int(course_list[i-1])
            tk.Label(frame_tenji,text=course_list[i-1],bg=self.num_color(course_num)['bg'],fg=self.num_color(course_num)['fg']).grid(row=i*2+1,column=9,sticky='nsew')
            tk.Label(frame_tenji,text='->').grid(row=i*2+1,column=11)
            tk.Label(frame_tenji,text=st_list[i-1]).grid(row=i*2+1,column=13)
            tk.Label(frame_tenji,text=' ').grid(row=i*2+1,column=8)
        for i in range(0,15,2):
            ttk.Separator(frame_tenji,orient='horizontal').grid(row=i,column=0,columnspan=8,sticky='ew')
        for i in range(0,15,2):
            ttk.Separator(frame_tenji,orient='horizontal').grid(row=i,column=9,columnspan=5,sticky='ew')
        frame_tenji.pack()

    def get_url_odds_list(self):
        url='https://www.boatrace.jp/owpc/pc/race/odds3t?rno='+self.race_rno+'&jcd='+self.jcd.zfill(2)+'&hd='+self.race_day
        time.sleep(1)
        response=request.urlopen(url)
        self.soup_odds_list=BeautifulSoup(response,'html.parser')
        response.close()

    def get_odds_list(self):
        soup=self.soup_odds_list
        odds=soup.find_all('td',class_='oddsPoint')
        self.odds_list=[]
        for i in range(6):
            for j in range(i,120,6):
                self.odds_list.append(odds[j].get_text())

    def create_odds(self):
        for i in range(1,7):
            tk.Label(self.frame_center,text=str(i)+'\u3000'+self.name_list[i-1],bg=self.num_color(i)['bg'],fg=self.num_color(i)['fg']).grid(row=0,column=3*i-3,columnspan=3,sticky='nsew')
        self.get_odds_list()
        self.odds_bool_list=[tk.BooleanVar() for i in range(len(self.odds_list))]
        self.pair_list=[]
        for i in range(1,7):
            count2=0
            for j in range(1,7):
                count3=0
                if j!=i:
                    count2 +=1
                    tk.Label(self.frame_center,text=str(j),bg=self.num_color(j)['bg'],fg=self.num_color(j)['fg']).grid(column=i*3-3,row=count2*4-3,rowspan=4,sticky='nsew')
                    for k in range(1,7):
                        if k!=i and k!=j:
                            count3 += 1
                            self.pair_list.append(str(i)+'-'+str(j)+'-'+str(k))
                            tk.Label(self.frame_center,text=str(k),bg=self.num_color(k)['bg'],fg=self.num_color(k)['fg']).grid(column=i*3-2,row=count2*4-4+count3,sticky='nsew')
                            tk.Checkbutton(self.frame_center,text=str(self.odds_list[20*i+4*count2+count3-25]),anchor='w',variable=self.odds_bool_list[20*i+4*count2+count3-25]).grid(column=i*3-1,row=count2*4-4+count3,sticky='nsew')

    def count_race_num(self):
        self.race_num += 1

    def get_profit_sum(self):
        profit_value=self.get_profit_value()
        self.profit_sum=self.profit_sum+profit_value

    def create_bet_button(self):
        self.current_info=tk.Label(self.frame_right,text=str(self.race_num)+'レース目-合計損益:'+'{:,d}円'.format(self.profit_sum),font=("MSゴシック", "15", "bold"))
        self.current_info.pack(anchor='ne',expand=True)
        tk.Button(self.frame_right,text='ベットリストを更新',command=self.renew_bet_list).pack()
    
    def renew_bet_list(self):
        self.price_sum=0
        for i in range(120):
            self.label_pair[i].grid_forget()
            self.label_odds[i].grid_forget()
            self.label_price[i].grid_forget()
            self.label_unit[i].grid_forget()
            self.label_delete[i].grid_forget()
            if self.odds_bool_list[i].get()==True:
                self.label_pair[i].grid(row=i*2+3,column=1)
                self.label_odds[i].grid(row=i*2+3,column=2)
                self.label_price[i].grid(row=i*2+3,column=3)
                self.label_unit[i].grid(row=i*2+3,column=4)
                self.label_delete[i].grid(row=i*2+3,column=5)
                self.price_sum=self.price_sum+int(self.label_price[i].get())
        self.label_price_sum['text']='合計金額:'+'{:,d}'.format(self.price_sum*100)[:-2]
        self.get_profit()

    def create_bet_list(self):
        frame_bet_list=tk.Frame(self.frame_right)
        tk.Label(frame_bet_list,text='組番').grid(row=1,column=1,sticky='nsew')
        tk.Label(frame_bet_list,text='オッズ').grid(row=1,column=2,sticky='nsew')
        tk.Label(frame_bet_list,text='金額').grid(row=1,column=3,columnspan=2,sticky='nsew')
        tk.Label(frame_bet_list,text='削除').grid(row=1,column=5,sticky='nsew')
        self.label_pair=list([0 for i in range(120)])
        self.label_odds=list([0 for i in range(120)])
        self.label_price=list([0 for i in range(120)])
        self.label_unit=list([0 for i in range(120)])
        self.label_delete=list([0 for i in range(120)])

        for i in range(120):
            self.label_pair[i]=tk.Label(frame_bet_list,text=self.pair_list[i])
            self.label_pair[i].grid(row=i*2+3,column=1)
            self.label_pair[i].grid_forget()

            self.label_odds[i]=tk.Label(frame_bet_list,text=self.odds_list[i])
            self.label_odds[i].grid(row=i*2+3,column=2)
            self.label_odds[i].grid_forget()

            self.label_price[i]=tk.Entry(frame_bet_list,justify='right')
            self.label_price[i].insert(tk.END,'1')
            self.label_price[i].grid(row=i*2+3,column=3)
            self.label_price[i].grid_forget()

            self.label_unit[i]=tk.Label(frame_bet_list,text='00円')
            self.label_unit[i].grid(row=i*2+3,column=4)
            self.label_unit[i].grid_forget()

            self.label_delete[i]=tk.Checkbutton(frame_bet_list,variable=self.odds_bool_list[i])
            self.label_delete[i].grid(row=i*2+3,column=5)
            self.label_delete[i].grid_forget()

        ttk.Separator(frame_bet_list,orient='horizontal').grid(row=2,column=0,columnspan=6,sticky='ew')   
        ttk.Separator(frame_bet_list,orient='horizontal').grid(row=242,column=0,columnspan=6,sticky='ew')   
        self.label_price_sum=tk.Label(frame_bet_list,text='合計金額:',anchor='e')
        self.label_price_sum.grid(row=120*2+3,column=3,sticky='e')
        tk.Label(frame_bet_list,text='00円').grid(row=120*2+3,column=4)
        frame_bet_list.pack()

    def desplay_result(self):
        self.frame_result.pack()
        self.frame_return.pack()
        self.get_profit_sum()
    
    def set_result_button(self):
        frame_result_button=tk.Frame(self.frame_right)
        tk.Button(frame_result_button,text='結果を表示',command=self.desplay_result).pack()
        frame_result_button.pack()

    def get_url_result(self):
        url='https://www.boatrace.jp/owpc/pc/race/raceresult?rno='+self.race_rno+'&jcd='+self.jcd.zfill(2)+'&hd='+self.race_day
        time.sleep(1)
        response=request.urlopen(url)
        self.soup_result=BeautifulSoup(response,'html.parser')
        response.close()

    def get_result(self):
        soup=self.soup_result
        goal_rank=soup.find_all('td',class_='is-fs14')
        goal_rank_list=list([goal_rank[i].get_text() for i in range(1,12,2)])
        for i in range(len(goal_rank_list)):
            if goal_rank_list[i]=='1':
                goal_rank_list[i]='1'
            elif goal_rank_list[i]=='2':
                goal_rank_list[i]='2'
            elif goal_rank_list[i]=='3':
                goal_rank_list[i]='3'
            elif goal_rank_list[i]=='4':
                goal_rank_list[i]='4'
            elif goal_rank_list[i]=='5':
                goal_rank_list[i]='5'
            elif goal_rank_list[i]=='6':
                goal_rank_list[i]='6'

        goal_num=soup.find_all('td',class_=lambda value: value and value.startswith('is-fs14 is-fBold is-boatColor'))
        goal_num_list=list([goal_num[i].get_text() for i in range(6)])

        goal_time=soup.find_all('td')
        goal_time_list=list([goal_time[i].get_text() for i in range(16,37,4)])

        res_course=soup.find_all('span',class_=lambda value: value and value.startswith('table1_boatImage1Number'))
        res_course_list=list([res_course[i].get_text() for i in range(6)])

        res_st=soup.find_all('span',class_='table1_boatImage1TimeInner')
        res_st_list=list([res_st[i].get_text().strip().replace('\r\n','').replace(' ','').replace('\u3000',' ') for i in range(6)])

        return_money=soup.find_all('td')[45].get_text()
        pop_num=soup.find_all('td')[46].get_text()
        return goal_rank_list,goal_num_list,goal_time_list,res_course_list,res_st_list,return_money,pop_num

    def create_result(self):
        self.frame_result=tk.Frame(self.frame_right)
        goal_rank_list,self.goal_num_list,goal_time_list,res_course_list,res_st_list,self.return_money,self.pop_num=self.get_result()
        goal_num_list=self.goal_num_list
        for i in range(len(self.result_col_list)):
            tk.Label(self.frame_result,text=self.result_col_list[i]).grid(row=1,column=i*2+1,sticky='nsew')
        tk.Label(self.frame_result,text='ST',anchor='w').grid(row=1,column=13,sticky='w')
        for i in range(1,7):
            goal_num=int(goal_num_list[i-1])
            tk.Label(self.frame_result,text=str(goal_num),bg=self.num_color(goal_num)['bg'],fg=self.num_color(goal_num)['fg']).grid(row=i*2+1,column=3,sticky='nsew')
            tk.Label(self.frame_result,text=self.name_list[goal_num-1]).grid(row=i*2+1,column=5)
            tk.Label(self.frame_result,text=goal_rank_list[i-1]).grid(row=i*2+1,column=1)
            tk.Label(self.frame_result,text=goal_time_list[i-1]).grid(row=i*2+1,column=7)
            res_course=int(res_course_list[i-1])
            tk.Label(self.frame_result,text=str(res_course),bg=self.num_color(res_course)['bg'],fg=self.num_color(res_course)['fg']).grid(row=i*2+1,column=9,sticky='nsew')
            tk.Label(self.frame_result,text='->').grid(row=i*2+1,column=11)
            tk.Label(self.frame_result,text=res_st_list[i-1],anchor='w').grid(row=i*2+1,column=13,sticky='w')
            tk.Label(self.frame_result,text=' ').grid(row=i*2+1,column=8)
        for i in range(0,15,2):
            ttk.Separator(self.frame_result,orient='horizontal').grid(row=i,column=0,columnspan=8,sticky='ew')
        for i in range(0,15,2):
            ttk.Separator(self.frame_result,orient='horizontal').grid(row=i,column=9,columnspan=5,sticky='ew')
        self.frame_result.pack()
        self.frame_result.pack_forget()

    def get_profit(self):
        lost=int(self.price_sum)
        return_price=int(self.return_money.replace('¥','').replace(',',''))
        pair=self.goal_num_list[0]+'-'+self.goal_num_list[1]+'-'+self.goal_num_list[2]
        i=self.pair_list.index(pair)
        if self.odds_bool_list[i].get()==True:
            profitstr='+{:,d}円'.format(return_price*int(self.label_price[i].get())-lost*100)
        else:
            profitstr='{:,d}円'.format(-lost*100)
        self.label_profit['text']=profitstr

    def get_profit_value(self):
        lost=int(self.price_sum)
        return_price=int(self.return_money.replace('¥','').replace(',',''))
        pair=self.goal_num_list[0]+'-'+self.goal_num_list[1]+'-'+self.goal_num_list[2]
        i=self.pair_list.index(pair)
        if self.odds_bool_list[i].get()==True:
            profit_value=return_price*int(self.label_price[i].get())-lost*100
        else:
            profit_value=-lost*100
        return profit_value

    def create_return(self):
        self.frame_return=tk.Frame(self.frame_right)
        for i in range(3):
            goal_num=int(self.goal_num_list[i])
            tk.Label(self.frame_return,text=str(goal_num),bg=self.num_color(goal_num)['bg'],fg=self.num_color(goal_num)['fg']).grid(row=3,column=i*2+2,sticky='nsew')
        for i in range(2):
            tk.Label(self.frame_return,text='-').grid(row=3,column=i*2+3)
        tk.Label(self.frame_return,text=self.return_money).grid(row=3,column=7)
        tk.Label(self.frame_return,text=self.pop_num).grid(row=3,column=8)
        tk.Label(self.frame_return,text='払戻金').grid(row=1,column=7)
        tk.Label(self.frame_return,text='人気').grid(row=1,column=8)
        tk.Label(self.frame_return,text='組番').grid(row=1,column=2,columnspan=5)
        tk.Label(self.frame_return,text='損益').grid(row=1,column=9)
        for i in range(0,5,2):
            ttk.Separator(self.frame_return,orient='horizontal').grid(row=i,column=0,columnspan=10,sticky='ew')

        self.label_profit=tk.Label(self.frame_return,text='0')
        self.label_profit.grid(row=3,column=9)

        self.frame_return.pack()
        self.frame_return.pack_forget()

win=tk.Tk()
app=create_app(win)
win.mainloop()

まとめ

全然売り物にはならないレベルなので公開しました。

これをさらに改良してよりよいものを作る参考にしていただけたら嬉しいです。

コメント

タイトルとURLをコピーしました