質問するログイン新規登録

回答編集履歴

3

リンク・アドレスの修正

2020/03/11 23:42

投稿

3109
3109

スコア80

answer CHANGED
@@ -25,7 +25,7 @@
25
25
  # 現在の年と月を属性に追加
26
26
  self.year = now.year
27
27
  self.month = now.month
28
- # 追記 https://teratail.com/questions/234639
28
+ # 追記 https://teratail.com/questions/234639#reply-355304
29
29
  global YEAR, MONTH
30
30
  YEAR = str(self.year)
31
31
  MONTH = str(self.month)
@@ -119,7 +119,7 @@
119
119
  self.current_year["text"] = self.year
120
120
  self.current_month["text"] = self.month
121
121
 
122
- # 追記 https://teratail.com/questions/234639
122
+ # 追記 https://teratail.com/questions/234639#reply-355304
123
123
  global YEAR, MONTH
124
124
  YEAR = str(self.year)
125
125
  MONTH = str(self.month)
@@ -135,7 +135,7 @@
135
135
  self.bind('<Button-1>', callback)# 追記 https://teratail.com/questions/234639
136
136
 
137
137
  # カレンダーの年月日を取得するコールバック関数
138
- # 追記 https://teratail.com/questions/234639
138
+ # 追記 https://teratail.com/questions/234639#reply-355304
139
139
  def callback(event):
140
140
  selected_date = ''
141
141
  if event.widget['text'] not in ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']:
@@ -145,7 +145,7 @@
145
145
  print(selected_date)
146
146
 
147
147
  # 1桁の数字を2バイトに変換する関数
148
- # 追記 https://teratail.com/questions/234639
148
+ # 追記 https://teratail.com/questions/234639#reply-355304
149
149
  def convert_in2_2bytes(str_number):
150
150
  if len(str_number) == 1:
151
151
  return '0' + str_number

2

表現の最適化

2020/03/11 23:42

投稿

3109
3109

スコア80

answer CHANGED
@@ -134,7 +134,7 @@
134
134
  self.configure(font=("",14),height=2, width=4, relief="flat")
135
135
  self.bind('<Button-1>', callback)# 追記 https://teratail.com/questions/234639
136
136
 
137
- # 左クリックされたカレンダーの年月日を取得する関数
137
+ # カレンダーの年月日を取得するコールバック関数
138
138
  # 追記 https://teratail.com/questions/234639
139
139
  def callback(event):
140
140
  selected_date = ''
@@ -159,8 +159,8 @@
159
159
  mycal.pack()
160
160
  root.mainloop()
161
161
  ```
162
- メインループ中にグローバル変数を宣言しなくても
162
+ メインループ中にグローバル変数を宣言しなくても
163
- 動作したので明示はしませんでした。
163
+ 動作するのを確認したので明示はしませんでした。
164
164
  もしも作法として誤りであれば御指摘ねがいます。
165
165
 
166
166
  datetimeモジュールが吐き出す

1

モジュール名の訂正

2020/02/02 03:44

投稿

3109
3109

スコア80

answer CHANGED
@@ -163,7 +163,7 @@
163
163
  動作したので明示はしませんでした。
164
164
  もしも作法として誤りであれば御指摘ねがいます。
165
165
 
166
- calendarモジュールが吐き出す
166
+ datetimeモジュールが吐き出す
167
167
  年・月・日の桁数の検査は記述していません。
168
168
  フル・フロンタル風に言うならば、
169
169
  「もし、西暦がカンストしたとしたら、