質問編集履歴
1
コードに反映できていなかったので訂正しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,11 +10,7 @@
|
|
10
10
|
AttributeError: 'Panel_2' object has no attribute 'textbox'
|
11
11
|
|
12
12
|
### 該当のソースコード
|
13
|
-
|
14
|
-
|
13
|
+
```python
|
15
|
-
|
16
|
-
ーーーーーー以下ソースコードーーーーーーーーーーー
|
17
|
-
|
18
14
|
import wx
|
19
15
|
import os
|
20
16
|
import subprocess
|
@@ -77,7 +73,7 @@
|
|
77
73
|
button3.Bind(wx.EVT_BUTTON, self.click_button3)
|
78
74
|
button3.SetBackgroundColour('#acd0c0')
|
79
75
|
|
80
|
-
button4 = wx.Button(self, -1, "
|
76
|
+
button4 = wx.Button(self, -1, "URL", pos=(538,300))
|
81
77
|
button4.SetSize((150,90))
|
82
78
|
button4.SetToolTip("B")
|
83
79
|
button4.Bind(wx.EVT_BUTTON,self. click_button4)
|
@@ -97,7 +93,7 @@
|
|
97
93
|
super().__init__(parent, wx.ID_ANY)
|
98
94
|
self.parent=parent
|
99
95
|
self.SetBackgroundColour('#75b1a9')
|
100
|
-
s_text_1 = wx.StaticText(self, wx.ID_ANY, '本日の
|
96
|
+
s_text_1 = wx.StaticText(self, wx.ID_ANY, '本日の記録欄', pos=(10,8))
|
101
97
|
font = wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_HEAVY)
|
102
98
|
s_text_1.SetFont(font)
|
103
99
|
|
@@ -167,27 +163,29 @@
|
|
167
163
|
self.parent.set_screen(Panel_1)
|
168
164
|
|
169
165
|
def click_button6(self, event):
|
170
|
-
|
166
|
+
otogename = self.combobox1.GetValue()
|
171
167
|
sukoa = self.numbertxt1.GetValue()
|
172
168
|
zyoutai = self.combobox2.GetStringSelection()
|
173
169
|
kyokumei = self.textbox.GetValue()
|
174
170
|
koment = self.textbox2.GetValue()
|
175
|
-
time = self.datetime.datetime.now()
|
171
|
+
time = self.datetime.datetime.now()
|
176
|
-
os.makedirs(desktop_path+r"\
|
172
|
+
os.makedirs(desktop_path+r"\test\ " + otogename , exist_ok=True)
|
177
|
-
f = open( desktop_path+r"\
|
173
|
+
f = open( desktop_path+r"\test\ " + otogename +"\ "+kyokumei +".txt" ,'a', encoding='UTF-8')
|
178
174
|
f.write(kyokumei+"\n")
|
179
|
-
datalist = ['スコア:'+str(sukoa)+'\n', '
|
175
|
+
datalist = ['スコア:'+str(sukoa)+'\n', '状態:'+zyoutai+'\n','コメント:'+koment,'\n記録日時・・・'+ str(time) +'\n\n\n\n']
|
180
176
|
f.writelines(datalist)
|
181
177
|
f.close()
|
182
178
|
|
183
|
-
|
179
|
+
def click_button7(self, event):
|
184
180
|
self.textbox.Clear()
|
185
181
|
self.textbox2.Clear()
|
186
182
|
self.combobox1.SetStringSelection("")
|
187
183
|
self.combobox2.SetStringSelection("")
|
188
|
-
self.numbertxt1.SetValue(0)
|
184
|
+
self.numbertxt1.SetValue(0)
|
189
185
|
|
186
|
+
```
|
190
187
|
|
188
|
+
|
191
189
|
### 試したこと
|
192
190
|
|
193
191
|
色々と書き方を変えてみたり、試行錯誤をしてみましたが改善できませんでした。
|