質問編集履歴

8

お願い致します。

2016/12/06 02:20

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -91,3 +91,5 @@
91
91
 
92
92
 
93
93
  スクリーンショット
94
+
95
+ ![イメージ説明](2e52e511a573c0abc1ae87f9a74b09aa.png)

7

ミス

2016/12/06 02:20

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -91,5 +91,3 @@
91
91
 
92
92
 
93
93
  スクリーンショット
94
-
95
- ![![イメージ説明](55fd1f183d9a69d0ea665173c904d6dd.png)](90727d02e78f5a70bfe0485a8726d5a2.png)

6

遅くなって申し訳ありません。スクリーンショットを添付したので、ご確認いただけますでしょうか。

2016/12/06 02:18

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -85,3 +85,11 @@
85
85
  というエラーが返ってくるのですが、文法ミスなのはわかっているのですが、なにが間違っているのでしょうか。
86
86
 
87
87
  ご教授願いたく。
88
+
89
+
90
+
91
+
92
+
93
+ スクリーンショット
94
+
95
+ ![![イメージ説明](55fd1f183d9a69d0ea665173c904d6dd.png)](90727d02e78f5a70bfe0485a8726d5a2.png)

5

追記

2016/12/06 02:18

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -78,8 +78,10 @@
78
78
 
79
79
  ^
80
80
 
81
+ SyntaxError: invalid syntax
82
+
81
83
  ```
82
84
 
83
- というエラーが返ってくるのですが、なにが間違っているのでしょうか。
85
+ というエラーが返ってくるのですが、文法ミスのはわかっているのですが、なにが間違っているのでしょうか。
84
86
 
85
87
  ご教授願いたく。

4

編集致しました。ご指摘ありがとうございます。

2016/12/02 11:13

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,8 @@
1
1
  コードについて質問です。
2
2
 
3
3
 
4
+
5
+ ```ここに言語を入力
4
6
 
5
7
  # -*- coding: utf-8 -*-
6
8
 
@@ -28,21 +30,55 @@
28
30
 
29
31
 
30
32
 
31
- if d["tags"] == []:
33
+ if d["A"] == []:
32
34
 
33
35
  continue
34
36
 
37
+ string = ''
38
+
39
+
40
+
41
+ for i, tag in enumerate(d["A"]):
42
+
43
+ if i != 0:
44
+
45
+ string += ' '
46
+
47
+ string += tag['A']
48
+
35
- 以下省略
49
+ try:
50
+
51
+ print string
52
+
53
+ string += '\n'
54
+
55
+ output.write(string.encode('utf-8'))
56
+
57
+ except UnicodeEncodeError:
58
+
59
+ pass
60
+
61
+
62
+
63
+ ```
64
+
65
+
66
+
67
+
36
68
 
37
69
  と記述していくと、
38
70
 
39
71
 
40
72
 
73
+ ```ここに言語を入力
74
+
41
75
  File "<stdin>", line 4
42
76
 
43
77
  for d in data:
44
78
 
79
+ ^
80
+
45
- ^(rの下)
81
+ ```
46
82
 
47
83
  というエラーが返ってくるのですが、なにが間違っているのでしょうか。
48
84
 

3

表示ミス

2016/12/02 10:40

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -42,7 +42,7 @@
42
42
 
43
43
  for d in data:
44
44
 
45
- ^
45
+ ^(rの下)
46
46
 
47
47
  というエラーが返ってくるのですが、なにが間違っているのでしょうか。
48
48
 

2

ミス

2016/12/02 07:15

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -22,17 +22,25 @@
22
22
 
23
23
  data.append(json.loads(line))
24
24
 
25
-
25
+
26
26
 
27
27
  for d in data:
28
28
 
29
+
30
+
31
+ if d["tags"] == []:
32
+
33
+ continue
34
+
29
35
  以下省略
30
36
 
31
- ~~~~~と記述していくと、
37
+ と記述していくと、
32
38
 
33
- File "<stdin>", line 2
34
39
 
40
+
35
- data.append(json.loads(line)):
41
+ File "<stdin>", line 4
42
+
43
+ for d in data:
36
44
 
37
45
  ^
38
46
 

1

記載漏れ

2016/12/02 07:11

投稿

unkle
unkle

スコア12

test CHANGED
File without changes
test CHANGED
@@ -34,6 +34,8 @@
34
34
 
35
35
  data.append(json.loads(line)):
36
36
 
37
+ ^
38
+
37
39
  というエラーが返ってくるのですが、なにが間違っているのでしょうか。
38
40
 
39
41
  ご教授願いたく。