def ec2_table(instances):
t = prettytable.PrettyTable(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:Name>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL>t.align = '<STR_LIT:l>'<EOL>for i in instances:<EOL><INDENT>name = i.tags.get('<STR_LIT:Name>', '<STR_LIT>')<EOL>t.add_row([i.id, i.state, i.monitored, i.image_id, name, i.instance_type, i.key_name, i.dns_name])<EOL><DEDENT>return t<EOL>
Print nice looking table of information from list of instances