Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8079547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:08:19+00:00 2026-06-05T16:08:19+00:00

I am new to Python and have been studying its fundementals for 3 months

  • 0

I am new to Python and have been studying its fundementals for 3 months now, learning types, functions and algorithms. Now I started practiciging web app development with GAE framework.

Goal: have a very large dictionary, which can be accessed from all .py files throughout the web app without having it stored more than once or re-created each time when someone visits a URL of the app.

I want to render a simple DB table to a dictionary, with hopes of speed gain as it will be in memory.

Also I am planing on creating an in memory DAWG – TRIE

I don’t want this dictionary to be created each time a page is called, I want it to be stored in memory once, kept there and used and accessed by all sessions and if possible modified too.

How can I achieve this? Like a simple in memory DB but actually a Python dictionary?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:08:24+00:00Added an answer on June 5, 2026 at 4:08 pm

    I’ll have a stab at this and put forward the standard python shelve module. This provides a simple persistent dictionary that is backed by an dbm file.

    There are a few caveats particularly relating to concurrency. It does provide some caching if writeback is enabled, but again there might be concerns re memory consumption. One other limitation is that keys must be strings.

    Still, it might be worth a look. It definitely fulfils the description of “pure Python hack”.

    Simple example:

    import shelve
    
    d = shelve.open('my_shelf')
    for i in range(100000):
        d[str(i)] = 'Item %s' % i
    d.close()
    d = shelve.open('my_shelf')
    >>> d['50000']
    'Item 50000'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Python (I have been programming in Java for multiple years now
hello im new to python and have been reading over the documentation and am
I'm new to Python and I have been trying to search through html with
I have been programming in Python for a while now, and have created some
I'm new to python and have been trying to figure this out all day.
I am new to python and have been working through the examples in Swaroop
I am still new to Python and have been reviewing the following code not
I am very new to Python and I have been trying to detect missing
I am new to python and I have been trying to change my php
I am reasonably new to the inner workings of Python. I have been trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.