Python Forum
Script for untagged resources in aws
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script for untagged resources in aws
#2
Take a look: EAFP

You can just handle the exception which is similar to providing a default value in dict.get() method.(probably how it works behind the scene)

PS:
Since you can use dict['Key'] to access the element it looks like a nested dictionary so .get should work too.

Edit: client.describe_instances does indeed return a dict. As stated in documents.
Reply


Messages In This Thread
Script for untagged resources in aws - by jutler - Jan-15-2019, 05:22 PM
RE: Script for untagged resources in aws - by hbknjr - Jan-15-2019, 06:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Resources for printing tabledata-Linux and Windows hammer 4 1,483 Apr-25-2022, 12:09 PM
Last Post: hammer
  Wanted to tag azure resources with creator name raham3406 0 1,479 Apr-25-2021, 02:24 PM
Last Post: raham3406
  Need learning resources for Python distribution gretchenfrage 2 2,180 Nov-12-2020, 06:42 PM
Last Post: gretchenfrage
  Resources for working with images and video? SheCurvesMobius 0 1,440 Mar-28-2020, 08:43 PM
Last Post: SheCurvesMobius
  AWS lambda script help - Listing untagged volumes jutler 0 2,275 Feb-13-2019, 02:36 PM
Last Post: jutler
  Resources for converting Python 2.x code to 3.x Luke_Drillbrain 4 5,080 May-03-2017, 06:34 PM
Last Post: snippsat
  Audiovisual resources Hacsa 4 4,331 Apr-30-2017, 08:36 AM
Last Post: Hacsa

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020