Creating .exe file in Python

subhabrata.banerji at gmail.com subhabrata.banerji at gmail.com
Tue Jun 16 12:23:08 EDT 2015


On Tuesday, June 16, 2015 at 9:33:58 PM UTC+5:30, Chris Angelico wrote:
> 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

Thank you for your reply. I am trying to experimenting over small ones before going to actual code. Your error interpretations are right.
I could work out a small solution please check if it is going fine.
It is giving me result.

if __name__ == "__main__":
    c1=Colors()
    c2=c1.Blue()
    c3=c1.Red()

Regards,
Subhabrata Banerjee. 



More information about the Python-list mailing list