Re: Faster GUI text control

2005-05-13 Thread Jeremy Bowers
On Fri, 13 May 2005 15:44:24 -0500, none wrote: > I'm trying to decide what is the best replacement for the control. I > was originally planning on redoing the GUI with wxpython, but I've seen > people indicate I would have the same problem. Honestly, if this is important to you, the best thin

Re: Q: The `print' statement over Unicode

2005-05-08 Thread Jeremy Bowers
On Sun, 08 May 2005 13:46:22 +, John J. Lee wrote: > I don't mean to put words into FranÃois' mouth, but IIRC he managed, > for example, GNU tar for some time and, while using some kind of > tracking system "under the covers", didn't impose it on his users. > > IMVHO, that was very nice of him

Re: Newbie : checking semantics

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 15:05:20 -0700, LDD wrote: > The fact that python doesn't check if the symbol > AFunctionThatIsntDefined is defined, is really bad when you develop big > pieces of code. You will never be sure that your code is free of this > kind of dummy errors and testing every possible execu

Re: Newbie: saving dialog variables

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 15:43:08 +, jeff elkins wrote: > === > import wx > > def create(parent): > return vents(parent) > > [wxID_VENTS, wxID_VENTSEXITBUTTON, > wxID_VENTSVENTTYPETEXT, > [snip] > > ] = [wx.NewId() for _init_ctrls in range(14) ] > > class vents(wx.Dialog): >

Re: Q: The `print' statement over Unicode

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 12:10:46 -0400, FranÃois Pinard wrote: > [Martin von LÃwis] > >> FranÃois Pinard wrote: >> >> > Am I looking in the wrong places, or else, should not the standard >> > documentation more handily explain such things? > >> It should, but, alas, it doesn't. Contributions are wel

Re: Newbie: saving dialog variables

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 13:24:34 +, jeff elkins wrote: > Howdy, > > I've written a program that calls an imported dialog to gather some needed > input. What's the common method for passing that data back to the caller? > I've > tried a 'return data' prior to self.Close() ... all that happens t

Re: Need help subclassing Borg

2005-05-07 Thread Jeremy Bowers
On Sun, 08 May 2005 02:42:09 +1000, Steven D'Aprano wrote: > I'm thinking what I might need is a function that generates a Borg-like > class. So I would do something like: > > Rabbit = MakeBorgClass() > # Rabbit is now a class implementing shared state > # all instances of Rabbit share the same st

Re: Listening to changes in a C++ variable from python

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 07:16:58 -0700, lamthierry wrote: > Is there some python method which can do the polling you are talking > about? Or can you send me a link to some existing example? Take a moment to go back to the basics. C++ is, in general, a simple system. The *language* is complicated at t

Re: Listening to changes in a C++ variable from python

2005-05-06 Thread Jeremy Bowers
On Fri, 06 May 2005 19:56:34 -0700, lamthierry wrote: > Let's say I have the following source code in C++: > > // The following is in a .cpp file > > int val = 0; > for ( int i = 0; i < 10; i++ ) >val = i; > > > // Now I'm in a python GUI, glade or GTK > Is it possible from the GUI side to

Re: How to detect a double's significant digits

2005-05-06 Thread Jeremy Bowers
On Fri, 06 May 2005 08:27:03 +0200, Fredrik Lundh wrote: > Jeremy Bowers wrote: > >> > A step which will require him to tell the printing routine how many >> > digits he wants printed. >> >> Not necessarily; consider the str() of a float in Python, especia

Re: How to detect a double's significant digits

2005-05-05 Thread Jeremy Bowers
On Thu, 05 May 2005 20:08:46 -0700, Erik Max Francis wrote: > Grant's point was that as significance is used in scientific studies, > there's no way to answer the question without having the number in > advance. My point was that the original poster never defined "significance" in that manner, and

Re: How to detect a double's significant digits

2005-05-05 Thread Jeremy Bowers
On Fri, 06 May 2005 02:44:43 +, Grant Edwards wrote: > On 2005-05-05, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > >> Since I think he mentioned something about predicting how much space it >> will take to print out, my suggestion is to run through whatever >> p

Re: How to detect a double's significant digits

2005-05-05 Thread Jeremy Bowers
On Thu, 05 May 2005 18:42:17 +, Charles Krug wrote: > On 5 May 2005 10:37:00 -0700, mrstephengross <[EMAIL PROTECTED]> > wrote: >> Hi all... How can I find out the number of significant digits (to the >> right of the decimal place, that is) in a double? At least, I *think* >> that's what I'm a

Re: How to write this regular expression?

2005-05-04 Thread Jeremy Bowers
On Thu, 05 May 2005 09:30:21 +0800, could ildg wrote: > Jeremy Bowers wrote: >> Python 2.3.5 (#1, Mar 3 2005, 17:32:12) [GCC 3.4.3 (Gentoo Linux >> 3.4.3, ssp-3.4.3-0, pie-8.7.6.6)] on linux2 Type "help", "copyright", >> "credits" or "

Re: empty lists vs empty generators

2005-05-04 Thread Jeremy Bowers
On Wed, 04 May 2005 20:33:31 +, Leif K-Brooks wrote: > With the EmptyGeneratorDetector class as you defined it, lists will fail: > > >>> EmptyGeneratorDetector([]) > Traceback (most recent call last): >File "", line 1, in ? >File "", line 15, in __init__ > AttributeError: 'list' objec

Re: How to write this regular expression?

2005-05-04 Thread Jeremy Bowers
On Wed, 04 May 2005 20:24:51 +0800, could ildg wrote: > Thank you. > > I just learned how to use re, so I want to find a way to settle it by > using re. I know that split it into pieces will do it quickly. I'll say this; you have two problems, splitting out the numbers and verifying their confor

Re: empty lists vs empty generators

2005-05-04 Thread Jeremy Bowers
On Wed, 04 May 2005 13:45:00 +, Leif K-Brooks wrote: > Jeremy Bowers wrote: >> def __init__(self, generator): >> self.generator = generator > > You'll want to use iter(generator) there in order to handle reiterables. Can you expand that explanation a

Re: empty lists vs empty generators

2005-05-02 Thread Jeremy Bowers
On Mon, 02 May 2005 16:14:57 -0700, Brian Roberts wrote: > Q1: Is there a better or alternate way to handle this? Q2: Is there a way > that handles both lists and generators, so I don't have to worry about > which one I've got? Are you in control of your generators? You could put a method on them

Re: compare two voices (Jeremy Bowers)

2005-05-02 Thread Jeremy Bowers
On Mon, 02 May 2005 16:37:19 -0500, phil wrote: > I will defend one statement though. I have yet to see anything which > Python would not make a good wrapper for. Some of the OpenGL pygame stuff > is very cool. Alright, you got me :-) I got excessively broad. -- http://mail.python.org/mailman/l

Re: compare two voices

2005-05-02 Thread Jeremy Bowers
On Mon, 02 May 2005 13:58:07 -0500, phil wrote: > You didn't indicate how deep you want to get into the code yourself. > > I am gonna step way out of my mathematical depth here I mean no disrespect, but this is the last accurate statement you made. I wouldn't say this, except that if the origin

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Jeremy Bowers
On Sun, 01 May 2005 06:18:27 -0700, Engineer wrote: > The security 'droids have decided that since the MS Office Suite is a > "standard" application then software written in MS Office VBA must be > "safe." "Melissa". (Google hint: "Virus".) Given the brazen stupidity demonstrated by these decisio

Re: compare two voices

2005-04-30 Thread Jeremy Bowers
On Sat, 30 Apr 2005 20:00:57 -0700, Qiangning Hong wrote: > I want to make an app to help students study foreign language. I want the > following function in it: > > The student reads a piece of text to the microphone. The software records > it and compares it to the wave-file pre-recorded by th

Re: How do I parse this ? regexp ? [slighly OT]

2005-04-28 Thread Jeremy Bowers
On Thu, 28 Apr 2005 20:53:14 -0400, Peter Hansen wrote: > The re docs clearly say this is not the case: > > ''' > [] > Used to indicate a set of characters. Characters can be listed > individually, or a range of characters can be indicated by giving two > characters and separating them by a "

Re: OOP

2005-04-28 Thread Jeremy Bowers
On Thu, 28 Apr 2005 10:34:44 -0700, demon_slayer2839 wrote: > Hey yall, > I'm new to Python and I love it. Now I can get most of the topics > covered with the Python tutorials I've read but the one thats just > stumping me is Object Orientation. I can't get the grasp of it. Does > anyone know of a

Re: creating very small types

2005-04-27 Thread Jeremy Bowers
On Wed, 27 Apr 2005 22:17:07 +0200, andrea wrote: > I was thinking to code the huffman algorithm and trying to compress > something with it, but I've got a problem. > How can I represent for example a char with only 3 bits?? > I had a look to the compression modules but I can't understand them muc

Re: tkinter text width

2005-04-27 Thread Jeremy Bowers
On Wed, 27 Apr 2005 12:52:21 -0700, James Stroud wrote: > Thank you to everybody helping me. I think I am almost there... > > On Wednesday 27 April 2005 12:10 pm, so sayeth Jeremy Bowers: >> 2. Use a fixed-width font and manually wrap. (It's pretty easy then, you >> can

Re: tkinter text width

2005-04-27 Thread Jeremy Bowers
On Wed, 27 Apr 2005 10:52:14 -0700, James Stroud wrote: > This is more or less what I would like, but I would also like to probe the > Text to see how many characters it thinks it can display within the container > window. I am formatting text dynamically and so I rely on the width. I am not > a

Re: How do I parse this ? regexp ?

2005-04-27 Thread Jeremy Bowers
On Wed, 27 Apr 2005 07:56:11 -0700, [EMAIL PROTECTED] wrote: > Hello all, > > I have this line of numbers: > > > 04242005 18:20:42-0.02, 271.1748608, [-4.119873046875, > 3.4332275390625, 105.062255859375], [0.093780517578125, 0.041015625, > -0.960662841796875], [0.01556396484375, 0.01220703

Re: delete will assure file is deleted?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 21:24:06 -0500, Mike Meyer wrote: > Jeremy Bowers <[EMAIL PROTECTED]> writes: > >> On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: >> os.remove, as the module name implies, tells the OS to do something. I >> would consider an OS that

Re: schedule a monthly ftp event

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 15:15:35 -0700, willitfw wrote: > Greetings, > I am looking for some guidance on a script. > > My goals are: > 1) have this script run automatically through a time set schedule. > 2) verify if a file is updated on an ftp site (usually on the 15th of > the month). > 3) If the u

Re: regex over files

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 20:54:53 +, Robin Becker wrote: > Skip Montanaro wrote: > ... >> If I mmap() a file, it's not slurped into main memory immediately, though as >> you pointed out, it's charged to my process's virtual memory. As I access >> bits of the file's contents, it will page in only w

Re: delete will assure file is deleted?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 21:24:30 +0200, andreas wrote: > On Tue, Apr 26, 2005 at 03:13:20PM -0400, Jeremy Bowers wrote: >> On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: >> >> > Hello Mike, >> > I have to know this topic otherwise my program has to ch

Re: regex over files

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 19:32:29 +0100, Robin Becker wrote: > Skip Montanaro wrote: >> Robin> So we avoid dirty page writes etc etc. However, I still think I >> Robin> could get away with a small window into the file which would be >> Robin> more efficient. >> >> It's hard to imagine how

Re: delete will assure file is deleted?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: > Hello Mike, > I have to know this topic otherwise my program has to check whether the > file / files are already deleted and this is a little bit messy. I would be fairly confident in asserting that assuming the file is there, you hav

Re: What's do list comprehensions do that generator expressions don't?

2005-04-26 Thread Jeremy Bowers
On Tue, 26 Apr 2005 02:12:07 -0500, Mike Meyer wrote: > Right. But that shouldn't be hard to do. Let genexp stand for a a > generator expression/list comprehension without any brackets on it at all. > Then [genexp] is the syntax to expand the list. [(genexp)] is the syntax > to create a list of one

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Jeremy Bowers
On Mon, 25 Apr 2005 23:00:57 -0500, Mike Meyer wrote: > Why do we have to wait for Python 3.0 for this? Couldn't list > comprehensions and generator expression be unified without breaking > existing code that didn't deserve to be broken? We don't; my mentioning 3.0 was just in reference to a previ

Re: Python or PHP?

2005-04-25 Thread Jeremy Bowers
On Mon, 25 Apr 2005 23:26:56 +, John Bokma wrote: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: Nobody ever changed their mind as a result of a 20-thread endless reply-fest. As usual, the posters aren't about to admit anything, and none of the bystanders are reading any mor

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Jeremy Bowers
On Mon, 25 Apr 2005 16:48:46 -0400, Bill Mill wrote: > On 25 Apr 2005 23:33:48 +0300, Ville Vainio <[EMAIL PROTECTED]> wrote: >> Still, list comprehensions should be implemented in terms of genexps to >> get rid of the LC variable that is visible outside the scope of the LC. >> >> > +1 . I thin

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Jeremy Bowers
On Sun, 24 Apr 2005 22:59:12 -0700, Robert Kern wrote: > Never. If you really need a list > > list(x*x for x in xrange(10)) > > Sadly, we can't remove list comprehensions until 3.0. Why "remove" them? Instead, we have these things called "comprehensions" (which, now that I say that, seems a rath

Re: Variables

2005-04-24 Thread Jeremy Bowers
On Sat, 23 Apr 2005 22:45:14 -0400, Richard Blackwood wrote: > Indeed, this language is math. My friend says that foo is a constant and > necessarily not a variable. If I had written foo = raw_input(), he would > say that foo is a variable. Which is perfectly fine except that he insists > that sinc

Re: Python or PHP?

2005-04-23 Thread Jeremy Bowers
On Sat, 23 Apr 2005 20:13:24 +0200, Mage wrote: > Avoid them is easy with set_type($value,"integer") for integer values and > correct escaping for strings. "Avoiding buffer overflows in C is easy, as long as you check the buffers each time." The *existence* of a technique to avoid problems is not

Re: Python Imaging Library and PyGTK - color image path?

2005-04-23 Thread Jeremy Bowers
On Sat, 23 Apr 2005 10:20:29 +0200, Fredrik Lundh wrote: > which discusses draw_rgb_image and friends, and says that "if you can > convert your PIL image to a pixel data string or buffer object, you could > use them to display the image". here's some code that seems to do exactly > that: > >

Re: Python Imaging Library and PyGTK - color image path?

2005-04-22 Thread Jeremy Bowers
On Fri, 22 Apr 2005 22:43:13 -0400, Jeremy Bowers wrote: > (Use case, in case it matters: I am trying to embed a graphic into a text > widget. This is going fine. Because I want the text widget to be able use > different size text, and no one image can look right with everything from >

Python Imaging Library and PyGTK - color image path?

2005-04-22 Thread Jeremy Bowers
I have an image in the Python Image Library. I'm trying to get it into PyGTK in color. Is there any way to do this cross-platform, preferably without writing to anything to the disk? PIL apparently can't write XPMs. GTK will only take XPMs, that I can see. Therein lies the rub. I can ship over mon

Re: Supercomputer and encryption and compression @ rate of 96%

2005-04-14 Thread Jeremy Bowers
On Thu, 14 Apr 2005 17:44:56 +0200, Fredrik Lundh wrote: > Will McGugan wrote: > >> Muchas gracias. Although there may be a bug. I compressed my Evanescence >> albumn, but after decompression it became the complete works of Charles > > strange. the algorithm should be reversible. sounds like a

Re: semicolons

2005-04-11 Thread Jeremy Bowers
On Tue, 12 Apr 2005 00:14:03 +0200, Mage wrote: >Hello, > > I amafraid of I will stop using semicolons in other languages after one > or two months of python. However I see that python simply ignores the > semicolons atd the end of the lines. > > What's your advice? I don't want to write

Re: workaround for generating gui tools

2005-04-10 Thread Jeremy Bowers
On Sun, 10 Apr 2005 13:02:27 -0700, Ken Godee wrote: > The original poster was just asking for an example of > how to sub class his code generated form into his program > for easy future updates, a "VERY STANDARD" way of doing it. I recognize your sarcasm, and I recognize the poor attitude it show

Re: workaround for generating gui tools

2005-04-10 Thread Jeremy Bowers
On Sun, 10 Apr 2005 13:57:26 +0200, Diez B. Roggisch wrote: >> Domain-specific abstractions do that *faster* than GUI designers, not >> slower. And better, too, since every iteration tends to be fully >> functional and not just a "let's see what this looks like" prototype. > > Can you show me som

Re: workaround for generating gui tools

2005-04-09 Thread Jeremy Bowers
On Sat, 09 Apr 2005 19:59:18 +0200, Diez B. Roggisch wrote: >> why use data files when you have an extremely powerful programming >> language in your toolbox? the advantage of building UI's in Python is >> that you can quickly create "domain specific UI languages", and use them >> to generate the

Re: Can dictionary values access their keys?

2005-04-08 Thread Jeremy Bowers
On Fri, 08 Apr 2005 10:33:53 -0600, Matthew Thorley wrote: > I must say I am *very* suprised that python does not have a way to look > up what key is pointing to a given object--without scanning the whole > list that is. Assuming fairly optimal data structures, nothing is free. Python chooses not

Re: args attribute of Exception objects

2005-04-08 Thread Jeremy Bowers
On Fri, 08 Apr 2005 09:32:37 +, SÃbastien de Menten wrote: > Hi, > > When I need to make sense of a python exception, I often need to parse the > string exception in order to retrieve the data. What exactly are you doing with this info? (Every time I started to do this, I found a better way

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Jeremy Bowers
On Wed, 06 Apr 2005 12:49:51 -0700, ritterhaus wrote: > Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This > is actually test code for a larger project... > > # flash the selected wx.TextControl > > for flasher in range(4): > self.textField.SetBackgroundColour(255, 0,

Re: unittest vs py.test?

2005-04-04 Thread Jeremy Bowers
On Mon, 04 Apr 2005 22:50:35 +, John J. Lee wrote: > What I don't understand about py.test (and trying it out seems > unlikely to answer this) is why it uses the assert statement. > unittest used to do that, too, but then it was pointed out that that > breaks when python -O is used, so unittest

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-04 Thread Jeremy Bowers
On Mon, 04 Apr 2005 17:02:20 -0400, Brian van den Broek wrote: > Jeremy suggested using a directory name akin to > "C:\onlyanidiotwouldhavethisdirecotrynameonadrive". That is what I had > settled on before I posted. Somehow it feels unhappy and inelegant. > But, I'm a bit less uncomfortable with

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Jeremy Bowers
On Sat, 02 Apr 2005 15:30:13 -0500, Brian van den Broek wrote: > So, how does one handle such cases with tests? When I had a similar situation, I created a directory for testing that was in a known state, and tested on that. If you can test based on a relative directory, that should work OK. Non-

FAM and Python? (was Re: How To Do It Faster?!?)

2005-04-01 Thread Jeremy Bowers
On Sat, 02 Apr 2005 02:02:31 +0200, andrea_gavana wrote: > Hello Jeremy & NG, > Every user of thsi big directory works on big studies regarding oil fields. > Knowing the amount of data (and number of files) we have to deal with > (produced > by simulators, visualization tools, and so on) and know

Re: How To Do It Faster?!?

2005-04-01 Thread Jeremy Bowers
On Sat, 02 Apr 2005 01:00:34 +0200, andrea_gavana wrote: > Hello Jeremy & NG, > ... > I hope to have been clearer this time... > > I really welcome all your suggestions. Yes, clearer, though I still don't know what you're *doing* with that data :-) Here's an idea to sort of come at the problem

Re: Help with splitting

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 18:01:49 -0500, Brian Beck wrote: > py> from itertools import groupby > py> [''.join(g) for k, g in groupby(' test ing ', lambda x: x.isspace())] > [' ', 'test', ' ', 'ing', ' '] > > I tried replacing the lambda thing with an attrgetter, but apparently my > understanding of

Re: that is it is not it (logic in Python)

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 22:01:25 +, F. Petitjean wrote: > Le Fri, 1 Apr 2005 13:39:47 -0500, Terry Reedy a Ãcrit : >> This is equivalent to '(that is it) and (it is not it)' which is clearly >> false. >> >>> False # What ? >> >> Reread the ref manual on chained comparison operators. > > And s

Re: Help with splitting

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 14:20:51 -0800, RickMuller wrote: > I'm trying to split a string into pieces on whitespace, but I want to > save the whitespace characters rather than discarding them. > > For example, I want to split the string '12' into ['1','','2']. > I was certain that there was a

Re: decorator syntax polling suggestion

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 16:52:52 -0500, Jeremy Bowers wrote: Oops, sorry, some "send later" messages I thought were gone got sent. Sorry. Didn't mean to revive dead threads. -- http://mail.python.org/mailman/listinfo/python-list

Re: decorator syntax polling suggestion

2005-04-01 Thread Jeremy Bowers
On Fri, 13 Aug 2004 16:49:53 +1000, Anthony Baxter wrote: > The > people who hate pie-decorators post a _lot_ - most people seem to either > not care, or else post once or twice and then disappear. I just posted on another mailing list about how posting the same message, over and over, is fundamen

Re: How To Do It Faster?!?

2005-04-01 Thread Jeremy Bowers
On Thu, 31 Mar 2005 13:38:34 +0200, andrea.gavana wrote: > Hello NG, > > in my application, I use os.walk() to walk on a BIG directory. I > need > to retrieve the files, in each sub-directory, that are owned by a > particular user. Noting that I am on Windows (2000 or XP), this is wha

Re: Pseudocode in the wikipedia

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 16:02:53 -0500, Gabriel Cooper wrote: > Ron_Adam wrote: > >>To me ":=" could mean to create a copy of an object... or should it >>be "=:" ? >> >>Or how about ":=)" to mean is equal and ":=(" to mean it's not. >> >>Then there is ";=)", to indicate 'True', and ':=O' to indicate

Re: try / except not worknig correctly

2005-04-01 Thread Jeremy Bowers
On Sat, 12 Mar 2005 17:06:17 -0800, '@'.join([..join(['fred','dixon']),..join(['gmail','com'])]) wrote: I'd also suggest validInput = "ABCDEFGHIJKL" # and there are more clever ways to do this, # but this will do myInput = raw_input(" ".join(validInput) + "?") if len(

Re: Decorater inside a function? Is there a way?

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 19:56:55 +, Ron_Adam wrote: > On Fri, 01 Apr 2005 13:47:06 -0500, Jeremy Bowers <[EMAIL PROTECTED]> > wrote: >>Is this an April Fools gag? If so, it's not a very good one as it's quite >>in line with the sort of question I've seen man

Re: Decorater inside a function? Is there a way?

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 18:30:56 +, Ron_Adam wrote: > I'm trying to figure out how to test function arguments by adding a > decorator. The rest of your message then goes on to vividly demonstrate why decorators make for a poor test technique. Is this an April Fools gag? If so, it's not a very goo

Re: unittest vs py.test?

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 16:42:30 +, Raymond Hettinger wrote: > FWIW, the evolution of py.test is to also work seemlessly with existing tests > from the unittest module. Is this true now, or is this planned? I read(/skimmed) the docs for py.test when you linked to the project, but I don't recall

Re: Lambda: the Ultimate Design Flaw

2005-04-01 Thread Jeremy Bowers
On Thu, 31 Mar 2005 23:30:42 -0800, Erik Max Francis wrote: > Daniel Silva wrote: > >> Shriram Krishnamurthi has just announced the following elsewhere; it might >> be of interest to c.l.s, c.l.f, and c.l.p: >> http://list.cs.brown.edu/pipermail/plt-scheme/2005-April/008382.html > > April Fool's

Re: html tags and python

2005-03-26 Thread Jeremy Bowers
On Sat, 26 Mar 2005 18:07:01 -0800, EP wrote: > Then... about the time you start to try to build a real application with > JavaScript, it will start to drive you mad... and you will have a new, > greater affection for Python. Actually, if you dig into it really hard, it's not bad. In fact of all t

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Jeremy Bowers
On Sat, 26 Mar 2005 15:42:03 +, Tim Tyler wrote: > I very much favour the smalltalk-inspired idea of keeping the actual > language as small as is reasonably possible. > > I wonder if there are any promising new kids on the dynamic > scripting-language block that I haven't heard about yet - i.e

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread Jeremy Bowers
On Fri, 25 Mar 2005 11:31:33 -0800, James Stroud wrote: > Now, what happened to the whitespace idea here? This code seems very > unpythonic. I think : is great for slices and lamda where things go on one > line, but to require it to specify the start of a block of code seems a > little perlish. It

Re: Suggestions for a Java programmer

2005-03-24 Thread Jeremy Bowers
On Thu, 24 Mar 2005 00:22:09 -0800, Ray wrote: > Can you point me to "Python for Java Programmers" resources? I found one > blog, but that only touched the tip of the iceberg, I feel. I know that as > I use Python more and read more books and read how experienced Python > programmers code, eventual

Re: setattr inside a module

2005-03-23 Thread Jeremy Bowers
On Wed, 23 Mar 2005 11:35:34 +0100, kramb64 wrote: > I'm trying to use setattr inside a module. > From outside a module it's easy: > > import spam > name="hello" > value=1 > setattr(spam, name, value) > > But if I want to do this inside the module spam itself, what I've to > pass to setattr as f

Limerick (was: Re: Text-to-speech)

2005-03-20 Thread Jeremy Bowers
On Sun, 20 Mar 2005 16:18:14 -0500, Steve Holden wrote: > Since it's PyCon week, I will offer a prize of $100 to the best (in my > opinion) limerick about Python posted to this list (with a Cc: to > [EMAIL PROTECTED]) before midday on Friday. The prize money will be my > own, so there are no oth

Re: Changing the Keyboard output

2005-03-20 Thread Jeremy Bowers
On Sun, 20 Mar 2005 19:30:05 +, Abdul Hafiz al-Muslim wrote: > Hi, > I am new to Python and still learning. > > I am looking for a way to change the keyboard output within Tkinter - for > example, say I press "p" and I want to come out as "t". > > Could anyone point me in the right direction

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Jeremy Bowers
On Sat, 19 Mar 2005 20:07:40 -0800, Kay Schluehr wrote: > It is bad OO design, George. I want to be a bit more become more > specific on this and provide an example: Having thought about this for a bit, I agree it is a powerful counter-argument and in many other languages I'd consider this a total

Re: Why tuple with one item is no tuple

2005-03-16 Thread Jeremy Bowers
On Wed, 16 Mar 2005 17:28:51 -0800, James Stroud wrote: > On Wednesday 16 March 2005 04:45 pm, Robert Kern wrote: >> > This would be very unambiguous. >> >> Not entirely. >> >> > Then, the purity would manifest itself the naked comma being an empty >> > tuple. Think about the zen of: >> > >> > Â Â

Re: Python becoming less Lisp-like

2005-03-16 Thread Jeremy Bowers
On Wed, 16 Mar 2005 16:35:57 -0600, Mike Meyer wrote: > The real problem is that newbies won't know which features are "meta" > features best left to experts, and which features are ok for everyday > programmers to use. > > We recently saw a thread (couldn't find it in google groups) where > some

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeremy Bowers
On Tue, 15 Mar 2005 03:21:48 -0800, Paul Boddie wrote: > Well, I've been using Python for almost ten years, and I've managed to > deliberately ignore descriptors and metaclasses quite successfully. I get > the impression that descriptors in particular are a detail of the > low-level implementation

Re: Jython Phone Interview Advice

2005-03-15 Thread Jeremy Bowers
On Tue, 15 Mar 2005 03:21:19 -0800, George Jempty wrote: > I'm noticing that Javascript's array/"hash" literal syntax is EXACTLY the > same as that for Python lists/dictionaries. No it isn't, quite. Two differences of note, one literally syntax and one technically not but you probably still want

Re: how to delete the close button (the X on the right most corner of the window) on a window

2005-03-13 Thread Jeremy Bowers
On Sun, 13 Mar 2005 09:25:43 -0800, jrlen balane wrote: > i am working on an MDIParentFrame and MDIChildFrame. Now, what i want > to do is make the ChildFrame not that easy to close by removing the > close button (the X on the right most corner of the window) if this is > possible... > > how am i

Re: dinamically altering a function

2005-03-12 Thread Jeremy Bowers
> What i want is to declare in the decorator some code that is common to all > these functions, so the functions assume that the decorator will be there > and wont need to duplicate the code provided by it, and the functions are > not known ahead of time, it has to be dynamic. This sounds like a c

Re: Add Properties to Instances?

2005-03-12 Thread Jeremy Bowers
On Sat, 12 Mar 2005 09:48:42 -0800, Martin Miller wrote: > I'm trying to create some read-only instance specific properties, but the > following attempt didn't work: I'm going to echo Steven's comment: "What's the situation in which you think you want different properties for different instances

Re: Adapting code to multiple platforms

2005-03-11 Thread Jeremy Bowers
On Fri, 11 Mar 2005 17:27:06 -0700, Jeffrey Barish wrote: > Most of my program lives in a class. My plan is to have a superclass > that performs the generic functions and subclasses to define methods > specific to each platform > I'm just getting up to speed on Python and OOP, so I'm wondering

Re: a RegEx puzzle

2005-03-11 Thread Jeremy Bowers
On Fri, 11 Mar 2005 08:38:36 -0500, Charles Hartman wrote: > I'm still shaky on some of sre's syntax. Here's the task: I've got > strings (never longer than about a dozen characters) that are > guaranteed to be made only of characters 'x' and '/'. In each string I > want to find the longest con

Re: yield_all needed in Python

2005-03-03 Thread Jeremy Bowers
On Thu, 03 Mar 2005 20:47:42 +, Paul Moore wrote: > This can probably be tidied up and improved, but it may be a > reasonable workaround for something like the original example. This is why even though in some sense I'd love to see yield *expr, I can't imagine it's going to get into the langua

Re: yield_all needed in Python

2005-03-02 Thread Jeremy Bowers
On Wed, 02 Mar 2005 22:54:14 +1000, Nick Coghlan wrote: > Douglas Alan wrote: >> Steve Holden <[EMAIL PROTECTED]> writes: >>>Guido has generally observed a parsimony about the introduction of >>>features such as the one you suggest into Python, and in particular >>>he is reluctant to add new keywo

Re: yield_all needed in Python

2005-03-01 Thread Jeremy Bowers
On Tue, 01 Mar 2005 12:42:51 -0600, Skip Montanaro wrote: > yield yield * (Mu-hu-ha-ha-ha!) -- http://mail.python.org/mailman/listinfo/python-list

Re: compatbility of .pyc files

2005-02-22 Thread Jeremy Bowers
On Wed, 23 Feb 2005 13:31:12 +1300, Blair Hall wrote: > I have a requirement to prevent 'accidental' tampering > with some software written in Python. If I ensure that all > of the modules concerned are compiled into .pyc's, and remove > the .py's to another location, then I should be safe until >

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Jeremy Bowers
On Fri, 18 Feb 2005 14:14:55 +1100, news.sydney.pipenetworks.com wrote: > I always wished computer science was more engineering then philosophy. > That way there'd always be an obvious answer. I hear that! To be fair, computer *science* is more like mathematics than philosophy; once a correctly-

Re: Help with research

2005-02-17 Thread Jeremy Bowers
On Thu, 17 Feb 2005 15:51:47 -0800, elena wrote: > I can go to my friends, however it occurred to me that it might be > better to post in a newsgroup and get a larger, more diverse, and > random sample. Larger, yes, more diverse, yes, more random, probably not in the statistical/scientific sense.

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Jeremy Bowers
On Thu, 17 Feb 2005 14:00:59 -0700, Dave Benjamin wrote: > Jeremy Bowers wrote: >> I'd point out that the Zen that can be comprehended by checking off items >> in a list is not the true Zen. > > The Zen that can be imported is not the eternal Zen. =) Yes, there

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Jeremy Bowers
On Fri, 18 Feb 2005 01:19:44 +1100, news.sydney.pipenetworks.com wrote: > Thanks for the pointer. Let's see how many zen points are for the OP's > idea vs against Along with the fact that I agree with Nick that you've seriously miscounted (most of your "fors" are simply irrelevant and I think you

Re: namespace collisions

2005-02-17 Thread Jeremy Bowers
On Thu, 17 Feb 2005 18:20:36 +, Will McGugan wrote: > I'm accumulating a number of small functions, which I have sensibly put > in a single file called 'util.py'. But it occurs to me that with such a > generic name it could cause problems with other modules not written by > myself. Whats the

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-17 Thread Jeremy Bowers
On Thu, 17 Feb 2005 18:49:38 +, Stephen Kellett wrote: > Incorrect analysis. This thread proves that you have no concept of how > to interact with the community. If you had done what many people asked > you to do, which is do some work yourself, then ask questions about the > few answers you

Re: Alternative to standard C "for"

2005-02-17 Thread Jeremy Bowers
On Thu, 17 Feb 2005 10:22:01 -0800, James Stroud wrote: > It seems I need constructs like this all of the time > > i = 0 > while i < len(somelist): > if oughta_pop_it(somelist[i]): > somelist.pop(i) > else: > i += 1 > > There has to be a better way... > > Any thoughts? Others have p

Re: "perl -p -i -e" trick in Python?

2005-02-15 Thread Jeremy Bowers
On Wed, 16 Feb 2005 15:18:57 +0900, Wonjae Lee wrote: > I read the comment of > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277753. > (Title : Find and replace string in all files in a directory) > > "perl -p -i -e 's/change this/..to this/g'" trick looks handy. > Does Python have a s

Re: Big development in the GUI realm

2005-02-12 Thread Jeremy Bowers
On Fri, 11 Feb 2005 14:45:09 -0800, Robert Kern wrote: > Until such matters are unequivocally determined in a court that has > jurisdiction over you, do you really want to open yourself to legal risk > and certain ill-will from the community? Huh? What are you talking about? I'm just pointing out

Re: Big development in the GUI realm

2005-02-11 Thread Jeremy Bowers
On Fri, 11 Feb 2005 18:24:22 +0100, Damjan wrote: > What you described is not ok according to the GPL - since you distributed > a binary thats derived from GPL software (and you didn't publish it source > code under the GPL too). No you didn't. You distributed a binary completely free of any GPL c

  1   2   >