Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code example运行出错 #480

Open
xinmans opened this issue Jan 11, 2023 · 0 comments
Open

code example运行出错 #480

xinmans opened this issue Jan 11, 2023 · 0 comments

Comments

@xinmans
Copy link

xinmans commented Jan 11, 2023

# -*- coding: utf8 -*-

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkecs.request.v20140526 import DescribeInstancesRequest
from aliyunsdkecs.request.v20140526 import StopInstanceRequest

# Initialize AcsClient instance
client = AcsClient(
  "<your-access-key-id>",
  "<your-access-key-secret>",
  "<your-region-id>"
)

# Initialize a request and set parameters
request = DescribeInstancesRequest.DescribeInstancesRequest()
request.set_PageSize(10)

# Print response
response = client.do_action_with_exception(request)
print response


python3 test.py 
  File "test.py", line 22
    print response
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(response)?

需要修改成print(response)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant