码迷,mamicode.com
首页 > 编程语言 > 详细

Python to list users in AWS

时间:2018-09-12 23:57:03      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:str   class   nsf   def   pytho   nbsp   www   dict   get   

code

import boto3
c1=boto3.client(iam)
#list_users will be a dict
users=c1.list_users()
#transfer dict to list
user_list=list(( r.get(UserName) for r in users.get(Users) ))
#print list
print(user_list)
#transfer list to string
for user_name in user_list:
   print(user_name)

refer

https://www.w3schools.com/python/default.asp

 

Python to list users in AWS

标签:str   class   nsf   def   pytho   nbsp   www   dict   get   

原文地址:https://www.cnblogs.com/oskb/p/9638046.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!