Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'scipy': 0.05; 'sys': 0.05; '"__main__":': 0.07; '__name__': 0.07; 'happen,': 0.07; 'objects,': 0.07; 'subject:file': 0.07; 'sys.stderr': 0.09; 'sys.stdout': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'def': 0.14; 'wed,': 0.15; '#this': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'silly': 0.16; 'wrote:': 0.16; 'first,': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'trying': 0.22; 'thanks.': 0.22; 'saying': 0.22; 'exceptions': 0.22; 'subject: .': 0.22; 'am,': 0.23; 'code,': 0.23; '2015': 0.23; 'import': 0.24; 'seems': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'separate': 0.27; 'message-id:@mail.gmail.com': 0.28; 'fine': 0.29; 'appear': 0.29; 'ball': 0.29; 'checking.': 0.29; 'print': 0.31; 'primary': 0.31; 'code': 0.31; 'getting': 0.33; 'class': 0.33; 'received:google.com': 0.34; 'something': 0.35; 'but': 0.36; 'two': 0.37; 'subject:: ': 0.37; 'expect': 0.39; 'why': 0.40; 'simple': 0.61; 'sample': 0.62; 'different': 0.64; 'believe': 0.67; 'state.': 0.72; '(also,': 0.84; 'chrisa': 0.84; 'fortunately,': 0.84; 'solved.': 0.84; 'to:none': 0.90 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=y8tMTjfB6g7s+dequFdoVUXEpEhEn7qQ5AFeagCoQDk=; b=GHgPlKIYguOxZP+S9aqCNbZ07mO8Yx637oVovXsJ6SRVHbdv0JVCcYJt/yT8dlG6ft W9i3JEx9aeoqd8r6CFWmbyw5GG734RMOmcbfJrwIuKOi2zh/iVYXfFdUtt40H3XX5QK3 cKgLvw/sAz4F7RbX6qqK0wCAlycn9+rY14MfoBYU/aZEV0FIzndyimBdAX6Z7NUZ74Mj sw30GT1I+ZOwBFU0r5o4+HTUjoZsckiaKq0wL4pgyxmCcr5FRHFLRK/+vwU5TlcYy5GB hNooEzDqWx4onaedAlm1OwxItAS6prM+sTQ1Wf9O1vnNk9TX5XyxMN9t0mTd/79mJr0Z YU/A== MIME-Version: 1.0 X-Received: by 10.107.134.198 with SMTP id q67mr1494526ioi.27.1434470619287; Tue, 16 Jun 2015 09:03:39 -0700 (PDT) In-Reply-To: <2de8f2c1-5a92-4f8b-be2d-c793de69d463@googlegroups.com> References: <349bb66f-bd3c-47ec-bd1d-35f46d23cf95@googlegroups.com> <2219d0b2-24a4-498b-b981-456faf0ceb44@googlegroups.com> <5f6b802f-049b-48e3-b1fd-a5915b7f3dbb@googlegroups.com> <2de8f2c1-5a92-4f8b-be2d-c793de69d463@googlegroups.com> Date: Wed, 17 Jun 2015 02:03:39 +1000 Subject: Re: Creating .exe file in Python From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434470627 news.xs4all.nl 2886 [2001:888:2000:d::a6]:60316 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92686 On Wed, Jun 17, 2015 at 1:17 AM, wrote: > Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code, > > import sys > sys.stderr = sys.stdout > class Colors: > def Blue(self): > self.var="This is Blue" > print self.var > def Red(self): > print self.var > > > > if __name__ == "__main__": > Colors().Blue() #THIS IS FINE > Colors().Red() #NOT FINE You're still not saying what's going on. Did you try this code as a simple Python script first, before trying to bundle it up into an .exe file? Fortunately, my primary crystal ball is active, and I believe what's going on is that you expect Blue() to set something and then Red() to see it. However, you're calling those methods on two different throw-away objects, so they have separate state. What you expect to happen, I honestly have no idea. (Also, why are you fiddling with sys.stderr? You don't then appear to be using it, unless you have an issue with exceptions getting printed to the other stream.) ChrisA