質問編集履歴
1
誤字などの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,25 +16,25 @@
|
|
16
16
|
|
17
17
|
```Python
|
18
18
|
|
19
|
-
|
19
|
+
try:
|
20
20
|
|
21
|
-
|
21
|
+
with open("coin/" + message.author.name + '.yaml') as yf:
|
22
22
|
|
23
|
-
|
23
|
+
coins = yaml.safe_load(yf)
|
24
24
|
|
25
|
-
|
25
|
+
coins = coins['Coins'] + random.randint(10,50)
|
26
26
|
|
27
|
-
|
27
|
+
except FileNotFoundError:
|
28
28
|
|
29
|
-
|
29
|
+
coins = 1
|
30
30
|
|
31
|
-
|
31
|
+
with open("coin/" + message.author.name + '.yaml', mode='w') as yf:
|
32
32
|
|
33
|
-
|
33
|
+
yaml.dump({
|
34
34
|
|
35
|
-
|
35
|
+
"Coins": coins
|
36
36
|
|
37
|
-
|
37
|
+
}, yf, default_flow_style=False)
|
38
38
|
|
39
39
|
```
|
40
40
|
|
@@ -59,5 +59,3 @@
|
|
59
59
|
|
60
60
|
|
61
61
|
repl.it
|
62
|
-
|
63
|
-
Python 1.3.4
|