Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'none,': 0.05; 'none:': 0.05; 'mentioned,': 0.07; 'none):': 0.07; 'python': 0.09; '"a"': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.10; 'static': 0.13; 'all"': 0.16; 'created.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:start': 0.16; 'wrote:': 0.17; 'variables': 0.17; 'code.': 0.20; 'variable': 0.20; 'file.': 0.20; 'object.': 0.22; 'header :User-Agent:1': 0.26; 'instead.': 0.27; 'there.': 0.28; 'header:X -Complaints-To:1': 0.28; 'objects': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; 'this.': 0.29; 'maybe': 0.29; 'classes': 0.30; 'function': 0.30; 'code': 0.31; 'file': 0.32; 'like:': 0.33; 'received:comcast.net': 0.33; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'something': 0.35; 'received:org': 0.36; 'except': 0.36; 'possible': 0.37; 'ok,': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'stay': 0.61; 'within': 0.64; 'apologize': 0.67; 'header:Reply- To:1': 0.68; 'soon': 0.70; 'lack': 0.71; 'reply-to:no real name:2**0': 0.72; 'subject:this': 0.84; '"stop"': 0.84; 'examples.': 0.84; 'scene': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Kene Meniru Subject: Re: Can't seem to start on this Followup-To: gmane.comp.python.general Date: Thu, 03 Jan 2013 09:06:55 -0500 Organization: illom.org References: <20130103082031.73a5b842@dilbert> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: c-69-143-75-245.hsd1.md.comcast.net User-Agent: KNode/4.4.7 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Kene.Meniru@illom.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357222033 news.xs4all.nl 6969 [2001:888:2000:d::a6]:51938 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36059 D'Arcy J.M. Cain wrote: > > OK, "global variables" is the clue that you need to rethink this. Try > to stay away from global variables as much as possible except for maybe > some simple setup variables within the same file. Consider something > like this instead. > The global variable is not part of the LinearMark object. It will be used by ALL objects created. I understand the uneasiness with this so maybe I will make it a function so it will be set with something like: SnapSize(num) > In file B: > > class TopClass(object): > def __init__(self, snap_size, var1 = None, var2 = None): > self.snap_size = snap_size > self.var1 = var1 > if var2 is None: self.var2 = 7 > self.var3 = "GO" > self.var4 = "Static string" > > *add class methods here* > > In file A: > > class MyClass(TopClass): > def __init__(self, var1): > TopClass.__init__(self, 10, var1, 8) > self.var3 = "STOP" > > x = MyClass(42) > x.var4 = "Not so static after all" > As I mentioned, the file "A" can be considered a scene file. I do not want the user to have to create classes there. I apologize for the lack of code. I will soon have some python code so my future questions will have some examples. Thanks for the comments.