Python Forum
How to modify item in dictionary?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to modify item in dictionary?
#6
Found it Smile

for key in doc['kml']['Document']['Placemark']:
	if "LineString" in key:
		print("Found LS")
		doc['kml']['Document']['Placemark']['Style'] = "blah"
Thanks for the help.
Reply


Messages In This Thread
How to modify item in dictionary? - by Winfried - Nov-21-2020, 12:48 AM
RE: How to modify item in dictionary? - by Winfried - Nov-21-2020, 01:37 AM
RE: How to modify item in dictionary? - by Winfried - Nov-21-2020, 12:55 PM
RE: How to modify item in dictionary? - by Winfried - Nov-21-2020, 01:01 PM
RE: How to modify item in dictionary? - by Winfried - Nov-21-2020, 01:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  For Loop and Use of Brackets to Modify Dictionary in Tic-Tac-Toe Game new_coder_231013 7 4,021 Dec-28-2021, 11:32 AM
Last Post: new_coder_231013
  Remove an item from a list contained in another item in python CompleteNewb 19 9,361 Nov-11-2021, 06:43 AM
Last Post: Gribouillis
  Modify a dictionary NathanF 2 2,920 Aug-29-2019, 03:36 PM
Last Post: NathanF
  looking fo an expression that yields a dictionary without an item Skaperen 5 4,264 Apr-09-2019, 02:05 AM
Last Post: Skaperen
  curious syntax with dictionary item inselbuch 3 3,701 Mar-09-2019, 04:21 PM
Last Post: ichabod801
  deleting item from dictionary Skaperen 6 4,215 Feb-20-2019, 01:18 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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