Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am writing python, but I find that the I can put all the script files on the directory, but it seems very messy. So, is there any conventions in the community to deal with the script files? Thanks.

share|improve this question

closed as not a real question by gnat, BЈовић, Kilian Foth, Martijn Pieters, Giorgio Mar 5 '13 at 9:54

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Read guide.python-distribute.org –  Martijn Pieters Aug 30 '12 at 8:19
    
@MartijnPieters you should post this as an answer –  Eliot Ball Aug 30 '12 at 9:56
    
@EliotBall: Fleshed it out to something worthy of an answer post; just a link is not an answer really. –  Martijn Pieters Aug 30 '12 at 10:35
    
naturally :) upvoted. –  Eliot Ball Aug 30 '12 at 10:46
    
This question on SO answers your question with respect to the file structure: stackoverflow.com/questions/193161/… –  jmlane Aug 30 '12 at 16:00

1 Answer 1

I can't speak for other languages, but Python has an extended packaging story.

Generally, you divide your project up in reusable components, and package them up in that manner. Metadata included with the setup.py script you set up for each package states what dependency each package has, so you can use tools like pip and buildout to deploy your projects.

Python provides a central package index to help discover and distribute such packages; for internal and customer releases we use a simple directory shared over the web and password protected through an Apache server.

Within a python package, you can still provide further structure using sub-directories, where each such directory is a nested package if there is an __init__.py file contained in that directory. Thus you can organize your code into various logical units. See the python tutorial on how this works.

I can heartily recommend the Hitchhiker’s Guide to Packaging; even though it is a document-in-progress, it is already a very enlightening tutorial on how to properly package and distribute your python code to others or for internal distribution.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.