0
0

More than 1 year has passed since last update.

pythonでシリアルコードでポイントが付与されるプログラム

Last updated at Posted at 2022-06-07

某キャンペーンサイトで英語の大文字でポイントを付与されるプログラムを見て、自分でも作ることは出来ないかと作ってみました、少しずつでも改善とコメントを追加していきます。

実行環境はpython ver3.8.3です。

from cProfile import label
from cgitb import text
from distutils.cmd import Command
import tkinter as tk
import string
import random

baseGround = tk.Tk()
# メインウィンドウ作成
baseGround.title("ポイントサイト")
# ウィンドウタイトル設定
baseGround.geometry("300x300")
# ウィンドウサイズ設定

all_point = 0 

point_deta = ["".join([random.choice(string.ascii_uppercase) for _ in range(3)])for _ in range(20)]

print(point_deta)

def btn_click():
    global all_point
    point_up = input_text.get().upper()
    label1["text"] = point_up
    if point_up in point_deta:
        all_point = all_point + 1
        
        label3["text"] = all_point
    else:
        label3["text"] = all_point
    label3["text"] = all_point
input_text = tk.Entry()
input_text.pack()

btn = tk.Button(baseGround, text = "入力", command = btn_click)
btn.pack()
label1 = tk.Label()
label1.pack()
label2 = tk.Label(text = "総ポイント数")
label2.pack()
label3 = tk.Label(text= all_point)
label3.pack()
     
baseGround.mainloop()
0
0
1

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