質問するログイン新規登録

質問編集履歴

2

内容の修正

2019/02/20 00:33

投稿

80ZX7OR0Bib6DNk
80ZX7OR0Bib6DNk

スコア12

title CHANGED
File without changes
body CHANGED
@@ -6,11 +6,11 @@
6
6
  ・実行結果
7
7
  ```ここに言語を入力
8
8
  Traceback (most recent call last):
9
- File "pyroad.py", line 42, in <module>
9
+ File "pyroad.py", line 40, in <module>
10
- allLines = returnLines(pyFileListGet(allFileListGet())) - pyroadCount
10
+ pyroadCount = sum(1 for line in open('pyroad.py')) # pyroad.pyの行数は除外
11
- File "pyroad.py", line 6, in allFileListGet
11
+ File "pyroad.py", line 40, in <genexpr>
12
- for root, dirs, files in os.walk(path):
13
- NameError: name 'os' is not defined
12
+ pyroadCount = sum(1 for line in open('pyroad.py')) # pyroad.pyの行数は除外
13
+ UnicodeDecodeError: 'cp932' codec can't decode byte 0x96 in position 927: illegal multibyte sequence
14
14
  ```
15
15
 
16
16
  です。

1

文法の修正

2019/02/20 00:33

投稿

80ZX7OR0Bib6DNk
80ZX7OR0Bib6DNk

スコア12

title CHANGED
File without changes
body CHANGED
@@ -4,12 +4,14 @@
4
4
  教えてください。よろしくお願いします。
5
5
 
6
6
  ・実行結果
7
+ ```ここに言語を入力
7
8
  Traceback (most recent call last):
8
9
  File "pyroad.py", line 42, in <module>
9
10
  allLines = returnLines(pyFileListGet(allFileListGet())) - pyroadCount
10
11
  File "pyroad.py", line 6, in allFileListGet
11
12
  for root, dirs, files in os.walk(path):
12
13
  NameError: name 'os' is not defined
14
+ ```
13
15
 
14
16
  です。
15
17
 
@@ -18,6 +20,7 @@
18
20
  このサイトの一つ目をそのままコピペしました。
19
21
 
20
22
  ・コード
23
+ ```ここに言語を入力
21
24
  import os
22
25
  import datetime
23
26
 
@@ -83,4 +86,5 @@
83
86
  break
84
87
 
85
88
  # データの書き込み
86
- fileWrite(allLines)
89
+ fileWrite(allLines)
90
+ ```