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 8398021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:55:49+00:00 2026-06-09T20:55:49+00:00

I know this question has been tossed around much but still it’s not very

  • 0

I know this question has been tossed around much but still it’s not very clear to me.
I have a file ‘vmsupport.py’. Among it’s many functions, it has one in particular where it needs to add a new element to a global dictionary ‘netpathdict’.I have declared

netpathdict={} 

at the start of the script because I want to use this dictionary in another function in an another file ‘core.py’. Contents of the vmsupport.py file:

  storefile="%s/netsummary_%s.html" % (full_paths[1].rsplit('/',1)[0],build)
  netpathdict[build] = storefile
  self.logger.debug("storefile at %s key of dictionary is %s" %(build,netpathdict[build]))

contents of ‘core.py’ file:

def view_networksummary(request,build):
 result_file= netpathdict[build]
 f = open(result_file,'r')
 return HttpResponse(f)
 f.close()    

So, my question is, how exactly do I import the dictionary to core.py and use it and how would I be sure that the dictionary in use is the edited one.(Actually the vmsupport.py file works on a daemon that continuously adds elements to the dictionary. Hence, it’s NOT a one time affair )
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-09T20:55:51+00:00Added an answer on June 9, 2026 at 8:55 pm

    how exactly do I import the dictionary to core.py and use it and how would I be sure that the dictionary in use is the edited one.

    You don’t. You import the containing module and mutate the object contained in the attribute.

    import foo
    foo.bar.append('baz')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked many times, but I have not been
I know this question has been asked a zillion times, but I still feel
I know this question has been done but I have a slightly different twist
I know this question has been floated, but there are not any answers. In
I know this question has been asked before but the solutions did not work
Ok guys I know this question has been asked before but I am very
I know this question has been asked a lot, but not yet to my
I know this question has been asked a bit before. But looking around I
I know this question has been asked before, but there was no clear answer.
I know this question has been asked before but I still haven't seen a

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.