質問編集履歴

2

再編集

2022/03/01 01:19

投稿

yousann
yousann

スコア4

test CHANGED
File without changes
test CHANGED
@@ -24,8 +24,8 @@
24
24
  canvas.create_image(320,220,image=img1,tag="illust")
25
25
 
26
26
  #ラベル配置
27
- **_serihu_text.place=tkinter.Label(text=\
27
+ **_serihu_text.place=tkinter.Label(text=
28
- "「」")
28
+ 王様"「魔王を倒したら褒美をやるぞ」")
29
29
  serihu_text.place(x=160,y=10)_**
30
30
  sys_text=tkinter.Lbal(text="褒美はいくら上げますか?",fg="red")
31
31
  sys_text.place(x=330,y=420)

1

ご指摘を受けた内容を修正

2022/03/01 00:51

投稿

yousann
yousann

スコア4

test CHANGED
File without changes
test CHANGED
@@ -2,6 +2,42 @@
2
2
  下記のコードを打ったのですが「serihu_text」の部分がnot defineとなります。
3
3
  どこが間違っているのでしょうか?
4
4
 
5
+ python
6
+
7
+ コード
8
+ import tkinter
9
+
10
+ #ウインドウ作成
11
+ root=tkinter.Tk()
12
+ root.title("勇者求む!")
13
+ root.minsize(640,480)
14
+ root.option_add,["メイリオ",14]
15
+
16
+ #画像読み込み
17
+ img1=tkinter.PhotoImage(file='img4/chap4-1-1.png')
18
+ img1=tkinter.PhotoImage(file='img4/chap4-1-2.png')
19
+ img1=tkinter.PhotoImage(file='img4/chap4-1-3.png')
20
+
21
+ #キャンバス作成
22
+ canvas=tkinter.Canvas(root,width=640,height=480)
23
+ canvas.place(x=0,y=0)
24
+ canvas.create_image(320,220,image=img1,tag="illust")
25
+
26
+ #ラベル配置
5
- serihu_text.place=tkinter.Label(text=\
27
+ **_serihu_text.place=tkinter.Label(text=\
6
28
  "「」")
7
- serihu_text.place(x=160,y=10)
29
+ serihu_text.place(x=160,y=10)_**
30
+ sys_text=tkinter.Lbal(text="褒美はいくら上げますか?",fg="red")
31
+ sys_text.place(x=330,y=420)
32
+
33
+ #入力ボックス配置
34
+ entry=tkinter.Entry(width=12)
35
+ entry.place(x=180,y=420)
36
+ gold_text=tkinter.Label(text="ゴールド")
37
+ gold_text.place(x=330,y=420)
38
+
39
+ #ボタン配置
40
+ button=tkinter.Button(text="決定")
41
+ button.place(x=420,y=420)
42
+
43
+ root.mainloop()