ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxpython-users] Py works, EXE doesn't here is stripped program, someone else verify please.
by Steve Freedenburg other posts by this author
Jul 18 2008 11:59AM messages near this date
Re: [wxpython-users] Py works, EXE doesn't here is stripped program, someone else verify please. | Re: [wxpython-users] Py works, EXE doesn't here is stripped program, someone else verify please.
Liken the following to the kid in wood shop that has no real "talent" with
woodworking, makes a bird house.  The bird house is ugly, none of the
cuts are straight, nails poking out, and generally earns him a D for his 
efforts.
The bird really doesn't care if it's house was made by a master craftsman
or this kid.  To it a house is a house...  And in reality the kid is 
satisfied with
his finishing a project, and maybe in time he'll learn to be the master 
craftsman.

I won't argue with you about being wasteful, or even ugly.
I'm sure in time I'll be able to adopt all the "pythonic" (as I've seen 
written
elsewhere) ways of coding, or even the way a real programmer would write
coe

As of this momment in time, I've done the best I know how to do with what 
I've
found here, from you all, the web, books, and trial and error.  I don't want 
to
put code into a program that I don't understand even if it's the holy grail 
of
code (unless it solves my problem with the EXE not working of course.)

I put total faith in you that what you are telling me is the right way to do 
things.
At the momment, what you see is what I've been able to accomplish with 
success,
with what I know and understand, and it has worked.

If my sucky coding is why the EXE doesn't work but the Py does than fine
I admit defeat, and I'll recode the whole thing.  But as a matter of 
learning the
language I'm maybe 4 weeks in, just 4.  I've done "some" programming before
as I have needed to, but we're talking REALLY small programs for micro-
controllers.  I've tried to drive this program in the same way.

I think you can appreciate that I'm in my infancy in Python, and some of the
stuff you guys are telling me may just be too advanced for me right now, yet
my way works atleast on a sloppy, 2-bit-hack-of -a-programmer, level.

I'm just trying to finish this one program, wrong way or right way.  As long
as it works I'll be happy, and probably in time, I'll have the technology to
rebuilt it, faster, stronger, superior in every way. (crack at the million 
dollar man.)

----- Original Message ----- 
From: "Tim Roberts" <timr@[...].com> 
To: <wxpython-users@[...].org> 
Sent: Friday, 18 July, 2008 14:16
Subject: Re: [wxpython-users] Py works, EXE doesn't here is stripped 
program, someone else verify please.


>  Steve Freedenburg wrote:
> >
> > I will attach the py file, the configuration file that TopiView makes 
> > when the user
> > sets it up, so you can see that too,  the "help" file which is as close 
> > to a __doc__
> > as could be, and a short wav file that will play when TopiView matches a
> > search string.  Small files really, maybe 85kb.
> 
>  But, can't you see how wasteful this code is?  If you want to add a 7th 
>  string, you have to make modifications ALL over the file.  Wouldn't it be 
>  obviously better to make this all a data structure:
> 
>  SearchStuff = [
>     {
>         'font': '0;-13;0;0;0;400;0;0;0;0;3;2;1;34;Arial',
>         'color': wx.BLACK,
>         'label': 'Your Label Here',
>         'search': 'Search String',
>         'soundpath': 'Not specified',
>         'soundfile': Not specified
>     },
>     {
>         'font': '0;-13;0;0;0;400;0;0;0;0;3;2;1;34;Arial',
>         'color': wx.BLACK,
>         'label': 'Your Label Here',
>         'search': 'Search String',
>         'soundpath': 'Not specified',
>         'soundfile': Not specified
>     },
>     ...
>  ]
> 
>  Now, instead of doing everything 6 times, you can do things once, in a 
>  loop:
>     for stuff in SearchStuff:
>         stuff['container'] = wx.MenuItem( Containers, -1, stuff['name'], 
>  'View or hide', wx.ITEM_CHECK );
>         Containers.AppendItem( stuff['container'] )
> 
>  and so on.
> 
>  If it were me, I would actually create a new class to hold all of this 
>  information, and create six instances of the class.  That would make it 
>  even cleaner.
> 
>  ANY time you find yourself writing the same code more than once, you need 
>  to think about how a data structure could help that.
> 
>  -- 
>  Tim Roberts, timr@[...].com
>  Providenza & Boekelheide, Inc.
> 
>  _______________________________________________
>  wxpython-users mailing list
>  wxpython-users@[...].org
>  http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>  

_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Steve Freedenburg
Werner F. Bruhin
Steve Freedenburg
Steve Freedenburg
Steve Freedenburg
Werner F. Bruhin
Steve Freedenburg
Werner F. Bruhin
Steve Freedenburg
Tim Roberts

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved