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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:14:25+00:00 2026-05-25T22:14:25+00:00

I am planning to write a visitors’ kiosk in python/GTK. The project will have

  • 0

I am planning to write a visitors’ kiosk in python/GTK. The project will have two applications, the frontend for the kiosk and the backend for management linked to a MySQL DB.

I want both applications to have common code.
I was thinking of structuring the project like so:

project.common – for common code

project.frontend – for the frontend.

project.backend – for the backend.

So:

project/
    common
    frontend
    backend

The problem that I’m going to have is that each application will have its own data_files and I will want the applications packaged separately. The frontend will just run on Linux and the backend will be on Windows(cx_freeze) and Linux.

Can anyone give me any advice?

  • 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-25T22:14:26+00:00Added an answer on May 25, 2026 at 10:14 pm

    You can have multiple directories (i.e. common/project, frontend/project, and backend/project directories) in your PYTHONPATH with overlapping hierarchies (i.e. each has project top level package), but by default Python will not be happy with this, because it uses the first matching directory it finds and does not search all of them as many other languages do (PHP, Java, etc.), so you will get import errors.

    However by putting this in each project/ directory’s __init__.py, you are effectively telling Python to keep looking and that this isn’t the only place to find code for this package:

    import pkgutil
    __path__ = pkgutil.extend_path(__path__, __name__)
    

    Many Pythonistas will shun and mock you for such ridiculous an aberration and declare the foolishness of this endeavor and possibly make unpleasant suggestions about your primate ancestry. “Namespace packages are a terrible idea” they’ll say. Prepare to defend your decision. And don’t you DARE add those two lines to your source tree without accompanying comments explaining what they do!

    This page has a good explanation of some of these concepts:
    Explanation: http://www.doughellmann.com/PyMOTW/pkgutil/

    If you follow this approach, you can make a distribution with common+frontend and another with common+backend.

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

Sidebar

Related Questions

I'm planning to write a pluggable application in python (+qt4). However I have great
I am planning to write an object-oriented shell (based on Python). I have many
I'm planning to write a web application (.net probably) that will need to analyze
I am planning to write web service in python. But, I found wsgi also
I'm planning to write couple applications for iPhone and wonder if there are any
I'm planning to write an interactive C++ geometry processing plug-in that will frequently sort
I am planning to write a few git hooks as a project which logs
I'm planning to write a simple spaceshooter. I have read that the repaint() method
I'm planning to write a C library which will act as an umbrella wrapper
I'm planning to write a program in Ruby to analyse some data which has

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.