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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:15:35+00:00 2026-06-03T12:15:35+00:00

I am making a python package where I currently have a structure as below:

  • 0

I am making a python package where I currently have a structure as below:

application/utils.py

class settings():
  function foo():
    bla bla bla

class debug():
  function bar():
    bla bla bla

Then in other modules the import of the settings and debug classes can be done as below:

import application.utils.settings
import application.utils.debug

But now, the classes are getting pretty big and I would like to put them in separates files.

application/utils/settings.py

class settings():
  function foo():
    bla bla bla

application/utils/debug.py

class debug():
  function bar():
    bla bla bla

In that case, importing the debug and settings classes would be as below:

import application.utils.settings.settings
import application.utils.debug.debug

That I feel quite unnatural.
Is it the right way to do that or am I missing something?

  • 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-03T12:15:36+00:00Added an answer on June 3, 2026 at 12:15 pm

    You can write in application/utils/__init__.py:

    from application.utils.settings import Settings
    from application.utils.debug import Debug
    

    Then you will access Settings and Debug classes shorter

    from application.utils import Settings
    from application.utils import Debug
    

    Don’t name your classes and modules the same. Read PEP8 about naming convention

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

Sidebar

Related Questions

I'm currently making an iphone web app based on Google App Engine (python). I
I have a question about python mechanize's proxy support. I'm making some web client
I've tried making a package for my python project, and this has an sh
I am learning Python and am making a Q&A script. I made one function
I am making a game in Python with Pyglet. I have just finished the
can someone point out a simple example of making a Python package using distutils
I'm currently busy making a Python ORM which gets all of its information from
I'm a new Python programmer who is making the leap from 2.6.4 to 3.1.1.
I am trying to learn python and am making a program that will output
I'm making a secure SSL connection to a server using python and M2Crypto. See

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.