回答編集履歴
1
コメントを受けての修正
test
CHANGED
@@ -7,3 +7,23 @@
|
|
7
7
|
print("hogehoge",file=f)
|
8
8
|
|
9
9
|
```
|
10
|
+
|
11
|
+
#追記
|
12
|
+
|
13
|
+
こういうことでしょうか?
|
14
|
+
|
15
|
+
```Python
|
16
|
+
|
17
|
+
import sys
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
with open("ファイル名", "w") as f:
|
22
|
+
|
23
|
+
sys.stdout = f
|
24
|
+
|
25
|
+
print("abcdefg\n")
|
26
|
+
|
27
|
+
some_other_function()
|
28
|
+
|
29
|
+
```
|