回答編集履歴

1

修正例を追記

2017/03/24 03:12

投稿

can110
can110

スコア38262

test CHANGED
@@ -1,3 +1,49 @@
1
1
  カッコの数が揃っていません。
2
2
 
3
3
  `response = table.get_item( ... `のあとの`)`が抜けています。
4
+
5
+
6
+
7
+ ```Python
8
+
9
+ def boto_setdown():
10
+
11
+ conn = boto.dynamodb2.connect_to_region(AWS_REGION, aws_access_key_id = AWS_ACCESS_KEY_ID, aws_secret_access_key = AWS_SECRET_ACCESS_KEY)
12
+
13
+ table = Table(AWS_TABLE_NAME, connection=conn)
14
+
15
+
16
+
17
+ try:
18
+
19
+ response = table.get_item(
20
+
21
+ Key={
22
+
23
+ 'NodeID': 1
24
+
25
+ }
26
+
27
+ ) # これが抜けている
28
+
29
+
30
+
31
+ #/' Server Error ' /#
32
+
33
+ except ClientError as e:
34
+
35
+ print(e.response['Error']['Message'])
36
+
37
+
38
+
39
+ else:
40
+
41
+ item = response['Item']
42
+
43
+ print("GetItem succeeded:")
44
+
45
+
46
+
47
+ return
48
+
49
+ ```