LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-06-2013, 01:49 PM   #1
Neruocomp
Member
 
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Rep: Reputation: 15
Question Python project layout


I've written a python program and it works, but now its time to clean it up and I can see it can be organized into client/server/common sections. Whats the best way to layout my source files for this. Also when it comes to packaging, is it possable to have it so its a single source download but by using either python setup.py install client or pythong setup.py server install, to have it install either client or server portions or both, all the while including common.
 
Old 06-07-2013, 08:44 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
In addition to the structural distinctions you made (client, server, common,) it's also good to separate code by the dependencies they draw in so that dependencies are only loaded if they're actually going to be used. Other than that, there are numerous ways to split up source, and it all comes down to what's maintainable.

I don't know how to add new command-line options for setup.py (probably not difficult,) but you can use os.environ to check environment variables, and use those to pass options.

Kevin Barry
 
  


Reply

Tags
python



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: New Project Extends Cloud Foundry to Python and Perl LXer Syndicated Linux News 0 05-19-2011 06:10 PM
a little python project I'm going to try Cultist Slackware 3 02-14-2011 05:01 PM
Fedora13 - KDE 4.4.5, KXKB won't change layout if particular layout is selected CzarEjey Linux - Desktop 0 09-03-2010 02:12 AM
I need help with project references in Python dickgregory Programming 1 03-12-2010 05:05 PM
python + qt/kde: layout problems Ephracis Programming 0 02-10-2007 03:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration