Python Forum
Updating dictionary in another py file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating dictionary in another py file
#2
don't store the dict in a py file.
Store it in a file, e.g. json and load it, then dump it back when you want to preserve the new data.
Of course, JSON is just an example, you can use simple text file, a db, etc.
Larz60+ and SheeppOSU like this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Updating dictionary in another py file - by buran - Mar-28-2021, 07:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  dictionary output to text file (beginner) Delg_Dankil 2 1,204 Jul-12-2023, 11:45 AM
Last Post: deanhystad
  Using dictionary to find the most sent emails from a file siliusu 6 7,608 Apr-22-2021, 06:07 PM
Last Post: siliusu
  Making a dictionary from a file instyabam 0 1,517 Oct-27-2020, 11:59 AM
Last Post: instyabam
  how can i create a dictionary of dictionaries from a file Astone 2 2,275 Oct-26-2020, 02:40 PM
Last Post: DeaD_EyE
  Convert all actions through functions, fill the dictionary from a file Astone 3 2,452 Oct-26-2020, 09:11 AM
Last Post: DeaD_EyE
  how to put text file in a dictionary infected400 2 3,009 Jan-06-2019, 04:43 PM
Last Post: micseydel
  Dictionary to .txt or .csv file stanthaman42 9 4,703 Aug-08-2018, 03:37 PM
Last Post: Vysero
  dictionary from file Zatoichi 5 3,861 Feb-11-2018, 07:15 PM
Last Post: j.crater
  Dictionary + File Reading palmtrees 2 4,895 Nov-15-2016, 05:16 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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