質問編集履歴
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -157,3 +157,5 @@
|
|
157
157
|
if __name__ == '__main__':
|
158
158
|
|
159
159
|
print(func())
|
160
|
+
|
161
|
+
```
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,9 +24,9 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
```Python
|
27
|
+
```Python
|
28
28
|
|
29
|
-
def main():
|
29
|
+
def main():#メインプログラム
|
30
30
|
|
31
31
|
while True:
|
32
32
|
|
@@ -61,3 +61,99 @@
|
|
61
61
|
|
62
62
|
|
63
63
|
```
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
```Python
|
72
|
+
|
73
|
+
def Testfunc2(): #別プログラム
|
74
|
+
|
75
|
+
base01.withdraw()
|
76
|
+
|
77
|
+
base13 = tk.Tk()
|
78
|
+
|
79
|
+
base13.withdraw()
|
80
|
+
|
81
|
+
response = msg.showwarning('省略')
|
82
|
+
|
83
|
+
p = subprocess.Popen(['shutdown', '/i'], shell = True, stdout = subprocess.PIPE)
|
84
|
+
|
85
|
+
Pc = p.communicate()
|
86
|
+
|
87
|
+
print(Pc)
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
return Pc
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
def func():
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
base03 = tk.Tk()
|
102
|
+
|
103
|
+
base03.withdraw()
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
global base01
|
112
|
+
|
113
|
+
base01 = tk.Tk()
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
Shutdown_Option = {0:a, 1:b, 2:c}
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
button4 = tk.Button(base01, text=Shutdown_Option[0], command=Testfun1)
|
126
|
+
|
127
|
+
button5 = tk.Button(base01, text=Shutdown_Option[1], command=Testfunc2)
|
128
|
+
|
129
|
+
button5_1 = tk.Button(base01, text=Shutdown_Option[2], command=Testfun3)
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
button4.pack()
|
136
|
+
|
137
|
+
button5.pack()
|
138
|
+
|
139
|
+
button5_1.pack()
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
base01.mainloop()
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
if __name__ == '__main__':
|
158
|
+
|
159
|
+
print(func())
|