Python Forum
Getting values from a dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting values from a dictionary
#5
(Mar-31-2021, 08:39 PM)deanhystad Wrote: Are you just trying to print information? You can print the dictionary or sub-dictionaries like this:
print('Real time', details['time']['real'])

If you don't like how that looks you could try the pretty print library.

https://docs.python.org/3/library/pprint.html

I would like to add it in my code and export the whole information to a TXT file.
How can I incorporate this new set of code to my project?
Reply


Messages In This Thread
Getting values from a dictionary - by brunolelli - Mar-31-2021, 07:24 PM
RE: Getting values from a dictionary - by brunolelli - Mar-31-2021, 08:46 PM
RE: Getting values from a dictionary - by snippsat - Mar-31-2021, 11:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace values in Yaml file with value in dictionary PelleH 0 152 Jun-12-2024, 02:40 PM
Last Post: PelleH
Question Using Lists as Dictionary Values bfallert 8 704 Apr-21-2024, 06:55 AM
Last Post: Pedroski55
  need to compare 2 values in a nested dictionary jss 2 1,014 Nov-30-2023, 03:17 PM
Last Post: Pedroski55
  Printing specific values out from a dictionary mcoliver88 6 1,589 Apr-12-2023, 08:10 PM
Last Post: deanhystad
Question How to print each possible permutation in a dictionary that has arrays as values? noahverner1995 2 1,885 Dec-27-2021, 03:43 AM
Last Post: noahverner1995
  Python dictionary with values as list to CSV Sritej26 4 3,224 Mar-27-2021, 05:53 PM
Last Post: Sritej26
  Conceptualizing modulus. How to compare & communicate with values in a Dictionary Kaanyrvhok 7 4,187 Mar-15-2021, 05:43 PM
Last Post: Kaanyrvhok
  Adding keys and values to a dictionary giladal 3 2,637 Nov-19-2020, 04:58 PM
Last Post: deanhystad
  In this dictionary all the values end up the same. How? Pedroski55 2 2,025 Oct-29-2020, 12:32 AM
Last Post: Pedroski55
  Counting the values ​​in the dictionary Inkanus 7 3,914 Oct-26-2020, 01:28 PM
Last Post: Inkanus

Forum Jump:

User Panel Messages

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