回答編集履歴
1
修正例を追記
answer
CHANGED
@@ -1,2 +1,25 @@
|
|
1
1
|
カッコの数が揃っていません。
|
2
|
-
`response = table.get_item( ... `のあとの`)`が抜けています。
|
2
|
+
`response = table.get_item( ... `のあとの`)`が抜けています。
|
3
|
+
|
4
|
+
```Python
|
5
|
+
def boto_setdown():
|
6
|
+
conn = boto.dynamodb2.connect_to_region(AWS_REGION, aws_access_key_id = AWS_ACCESS_KEY_ID, aws_secret_access_key = AWS_SECRET_ACCESS_KEY)
|
7
|
+
table = Table(AWS_TABLE_NAME, connection=conn)
|
8
|
+
|
9
|
+
try:
|
10
|
+
response = table.get_item(
|
11
|
+
Key={
|
12
|
+
'NodeID': 1
|
13
|
+
}
|
14
|
+
) # これが抜けている
|
15
|
+
|
16
|
+
#/' Server Error ' /#
|
17
|
+
except ClientError as e:
|
18
|
+
print(e.response['Error']['Message'])
|
19
|
+
|
20
|
+
else:
|
21
|
+
item = response['Item']
|
22
|
+
print("GetItem succeeded:")
|
23
|
+
|
24
|
+
return
|
25
|
+
```
|