Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-20 Thread Brian Victor
Tim Harig wrote: > Posting two URLs rather defeats the purpose of using a URL shortening > service in the first place; but, if that is what you feel is effective, > then by all means, do so. You are the master of your posts and you have > the right to post them using whatever methods and formating

Re: looping through possible combinations of McNuggets packs of 6,9 and 20

2010-08-12 Thread Brian Victor
Baba wrote: > def can_buy(n_nuggets): [snip] > can_buy(55) > > as you can see i am trying to loop through all combinations of values > bewtween 1 and n_nuggets and when the equation resolves it should > return True, else it should return False. > > I was hoping that when i then call my function and

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Brian Victor
Steven D'Aprano wrote: > On Sat, 31 Jul 2010 14:25:39 +1200, Gregory Ewing wrote: > >> Steven D'Aprano wrote: >> >>> A >>> / \ >>> C B >>> \ / >>> D >>> / \ >>> E F >>> >>> Yes, a super call might jog left from C to B, but only when being >>> called from one

Re: Accumulate function in python

2010-07-19 Thread Brian Victor
dhruvbird wrote: > Hello, > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] > What is the best way (or p

Re: Solutions for hand injury from computer use

2010-07-01 Thread Brian Victor
Emile van Sebille wrote: > When I started having trouble about ten years ago, I switched to a > keyboard with integrated mouse pad. No problems since... Where did you find that? I've been looking for one. (Assuming you mean a trackpad, and not a mouse pad.) That said, my own solution was the

Re: Dynamic Form

2009-09-24 Thread Brian Victor
victorsubervi wrote: > On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote: >> Is your web browser re-submitting the form with the same data if you >> refresh the screen? > yes I'm surprised no one has mentioned this before, but the standard approach to this problem is to redirect after a successful

Re: wxPython beginners problem

2008-08-15 Thread Brian Victor
Ivan Reborin wrote: > win.Show This line isn't doing anything. It needs to be: win.Show() # note the parentheses -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: shorten this: if char in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz":

2008-06-24 Thread Brian Victor
cirfu wrote: > if char in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz": > > cant i write something like: > if char in "[A-Za-z]": Either of the following should do what you want, without resorting to regular expressions: import string if char in string.letters: or if char.isalpha():

Re: [OT] Fractions on musical notation

2007-12-16 Thread Brian Victor
Gabriel Genellina wrote: > On 16 dic, 06:40, Lie <[EMAIL PROTECTED]> wrote: > >> [btw, off topic, in music, isn't 1/4 and 2/8 different? I'm not very >> keen of music though, so correct me if I'm wrong.] > As a time signature 1/4 has no sense Actually, I'm playing a show right now that has a one b

OpenGL on Intel Mac

2006-04-06 Thread Brian Victor
I am attempting to build PyOpenGL on my Intel iMac. The transcript of the build failure is here: http://brianhv.org/temp/pyopengl-build.log I'm using the universal MacPython 2.4.3 and PyOpenGL-2.0.1.09. The highlight of the build log is: /System/Library/Frameworks/Kernel.framework/Headers/sys/s

Re: python gui using boa

2005-11-24 Thread Brian Victor
ash wrote: > I have another query for you - how can i make a captionless frame > draggable in wxWindows? If you look at the wxPython demo, there's a Shaped Window demo under Miscellaneous that does this. The key portion is on line 86 in my version: #v+ def OnMouseMove(self, evt): if evt.Drag

Re: python gui using boa

2005-11-23 Thread Brian Victor
ash wrote: > Thanks Steve, i found out the solution to the problem. but a good > tutorial on sizers is still missing. Try this article I wrote a while back. It should at least help you get started. The code samples are written in C++, but they are trivially translated to python. (Change -> to

Re: [newbie]search string in tuples

2005-08-20 Thread Brian Victor
Viper Jack wrote: > but i want check on several object inside the tuple so i'm trying this: > > list=["airplane","car","boat"] Note that this is actually a list, not a tuple as your subject suggests. For the difference, take a look at this: http://www.python.org/doc/faq/general.html#why-are-there-

Re: Wheel-reinvention with Python

2005-08-15 Thread Brian Victor
[EMAIL PROTECTED] wrote: > Torsten Bronger wrote: >> I've been having a closer look at wxPython which is not Pythonic at >> all and bad documented. Probably I'll use it nevertheless. > Aye. Couldn't agree more. You know, whenever someone mentions wxPython being badly documented, I have to wonder

Re: Sizers VS window size

2005-02-22 Thread Brian Victor
Deltones wrote: > However, if I add this part from the tutorial, I get a much smaller > window. Why is there an interference with the result I want when > adding the sizer code? [snip] > self.sizer.Fit(self) As noted in the the docs for Fit(): "Tell the sizer to resize the window to match the size