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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:17:07+00:00 2026-05-22T16:17:07+00:00

I manage a fairly large python-based quantum chemistry suite, PyQuante . I’m currently struggling

  • 0

I manage a fairly large python-based quantum chemistry suite, PyQuante. I’m currently struggling with how to set various defaults so that users can choose among different options at runtime.

For example, I have three different methods for computing electron repulsion integrals. Let’s call them a,b,c. I used to simply pick the one I liked best (say, c), and have that hard-wired into the module that computes these integrals.

I have now modified this to use a module, Defaults.py, that contains all such hard-wires. But this is set at compile/install time. I would now like users to be able to override these options at runtime, say, using a .pyquanterc.py file.

In my integral routines, I currently have something like

from Defaults import integral_method

I know about dictionaries, and the .update() method. But I don’t know how I would use this in real life. My defaults module looks like

integral_method = c

should I modify the end of Defaults.py to look for a .pythonrc.py file and override these values? E.g.

if os.path.exists('$HOME/.pythonrc.py'): do_something

If so, what should do_something look like?

  • 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-05-22T16:17:08+00:00Added an answer on May 22, 2026 at 4:17 pm

    With your current setup, the user can change the default functions in his scripts quite easily:

    import Defaults
    Defaults.integral_method = somefunc
    

    If the user adds this to his script, all your modules that use integral_method from Defaults will use somefunc to calculate integrals.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Develop Fairly large python application on server side , with all database connect
I'm currently working on a fairly large project that has been migrated from Ant
I manage a rather large application (50k+ lines of code) by myself, and it
We have several fairly large JavaScript files embedded into a single script resources DLL.
I have a fairly simple C# application that has builds a large hashtable. The
Although this is a fairly common problem, I am struggling with what the best
We have a fairly large MVC project with a large number of views and
I work on a fairly simple but large two-tier application that consists approximately 40
I'm building a fairly large website in Django, and it's my first time doing
I'm working on an fairly large ASP application that will be fully localized. I'm

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.