回答編集履歴
1
条件を間違っていたので修正
answer
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
tkinterのEntryには入力された文字列の検証を行う ``validatecommand`` という仕組みがありますので、これを使うことを推奨いたします。
|
1
|
+
tkinterのEntryには入力された文字列の検証を行う ``validatecommand`` (``vcmd``) という仕組みがありますので、これを使うことを推奨いたします。
|
2
2
|
|
3
3
|
[https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/entry-validation.html](https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/entry-validation.html)
|
4
4
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
# 文字列検証関数
|
10
10
|
def validation(before_word, after_word):
|
11
|
-
return (after_word.isdecimal()) and (len(after_word)<=4)
|
11
|
+
return ((after_word.isdecimal()) and (len(after_word)<=4)) or (len(after_word) == 0)
|
12
12
|
|
13
13
|
def InWork(event):
|
14
14
|
Status = "出勤"
|