質問編集履歴

2

内容の修正

2019/02/20 00:33

投稿

80ZX7OR0Bib6DNk
80ZX7OR0Bib6DNk

スコア12

test CHANGED
File without changes
test CHANGED
@@ -14,15 +14,15 @@
14
14
 
15
15
  Traceback (most recent call last):
16
16
 
17
- File "pyroad.py", line 42, in <module>
17
+ File "pyroad.py", line 40, in <module>
18
18
 
19
- allLines = returnLines(pyFileListGet(allFileListGet())) - pyroadCount
19
+ pyroadCount = sum(1 for line in open('pyroad.py')) # pyroad.pyの行数は除外
20
20
 
21
- File "pyroad.py", line 6, in allFileListGet
21
+ File "pyroad.py", line 40, in <genexpr>
22
22
 
23
- for root, dirs, files in os.walk(path):
23
+ pyroadCount = sum(1 for line in open('pyroad.py')) # pyroad.pyの行数は除外
24
24
 
25
- NameError: name 'os' is not defined
25
+ UnicodeDecodeError: 'cp932' codec can't decode byte 0x96 in position 927: illegal multibyte sequence
26
26
 
27
27
  ```
28
28
 

1

文法の修正

2019/02/20 00:33

投稿

80ZX7OR0Bib6DNk
80ZX7OR0Bib6DNk

スコア12

test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  ・実行結果
12
12
 
13
+ ```ここに言語を入力
14
+
13
15
  Traceback (most recent call last):
14
16
 
15
17
  File "pyroad.py", line 42, in <module>
@@ -21,6 +23,8 @@
21
23
  for root, dirs, files in os.walk(path):
22
24
 
23
25
  NameError: name 'os' is not defined
26
+
27
+ ```
24
28
 
25
29
 
26
30
 
@@ -37,6 +41,8 @@
37
41
 
38
42
 
39
43
  ・コード
44
+
45
+ ```ここに言語を入力
40
46
 
41
47
  import os
42
48
 
@@ -169,3 +175,5 @@
169
175
  # データの書き込み
170
176
 
171
177
  fileWrite(allLines)
178
+
179
+ ```