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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:04:57+00:00 2026-05-26T17:04:57+00:00

I wrote a python program which I call with arguments from console. As the

  • 0

I wrote a python program which I call with arguments from console. As the functionality grew, so did the amount of code that is now all nested in one single file.

I know that there are python modules and packages which I could create in order to outsource the functions I wrote. But is this really the python way of doing things?

How would the folder structure look like? Something like

prog
  __init__.py
  module1.py
  module2.py
prog.py

where prog (a directory or python package) and prog.py share the same directory?

  • 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-26T17:04:57+00:00Added an answer on May 26, 2026 at 5:04 pm

    That’s a good solution, thought your modules should be stored in a package not called like your main module. This would be prone to conflict between module and package name.

    This could be resources, lib or anything, but please, not prog, as you already have a module named prog.py; otherwise, how would you know the result of import prog?

    Note: from what I can see in my Python 2.6 install, with the structure and names you propose, you get no error message, but cannot access to prog.py content.

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

Sidebar

Related Questions

I have a python program which takes input from stdin. Now, I've to write
A coworker recently wrote a program in which he used a Python list as
I want to call an external program from within python, but this external program
A while back I wrote a simple python program to brute-force the single solution
I wrote a quick program in python to add a gtk GUI to a
I wrote a basic Hippity Hop program in C, Python, and OCaml. Granted, this
I've been playing with Python for a while and wrote a little program to
I am trying to write a python program that calculates a histogram, given a
Can I use os.system() or subprocess.call() to execute a Python program on a webserver?
I'm writing a python script that uses subprocess.Popen to execute two programs (from compiled

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.