Re: sort one list using the values from another list

2006-02-26 Thread Ron Adam
(zip(s2,s1)) s1[:] = (d[n] for n in sorted(d.keys())) It's faster on my system because d.keys() is already sorted. But that may not be the case on other versions of python. Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: sort one list using the values from another list

2006-02-26 Thread Ron Adam
Alex Martelli wrote: Ron Adam [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Your solution Steven Bethard looks very intelligent, here is a small speed test, because sorting a list according another one is a quite common operation. (Not all solutions are really the same, as Alex has

Re: sort one list using the values from another list

2006-02-26 Thread Ron Adam
(d.keys())) Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: sort one list using the values from another list

2006-02-26 Thread Ron Adam
Alex Martelli wrote: Ron Adam [EMAIL PROTECTED] wrote: ... Considering the number time I sort keys after getting them, It's the behavior I would prefer. Maybe a more dependable dict.sortedkeys() method would be nice. ;-) sorted(d) is guaranteed to do exactly the same thing as sorted

Re: sort one list using the values from another list

2006-02-26 Thread Ron Adam
Delaney, Timothy (Tim) wrote: Ron Adam wrote: Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 I was a bit surprised by them being sorted. I just happend to try d.keys() in place of s2, and it sped up. I was expecting it to be a bit slower. Purely

Re: Is Python a Zen language?

2006-02-25 Thread Ron Stephens
Actually, Python has the distinction of being both a great tool language *and* a great Zen language. That's what makes Python so cool ;-))) Ron Stephens Python411 www.awaretek.com/python/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-06 Thread Ron Rogers Jr.
/lib/python2.4/idlelib/idle.py CronoCloud (Ron Rogers Jr.) -- http://mail.python.org/mailman/listinfo/python-list

Needing a WinXP Python variant of a line of code

2006-01-30 Thread Ron Rogers Jr.
I have this line of code that's written with Linux in mind: path_to_nethack_logfile = os.popen(locate logfile | grep nethackdir).read() and I'm wanting a Windows equivalent, any suestions? Thanks. CronoCloud (Ron Rogers Jr.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Needing a WinXP Python variant of a line of code

2006-01-30 Thread Ron Rogers Jr.
Tim Golden wrote: [Ron Rogers Jr.] | I have this line of code that's written with Linux in mind: | | path_to_nethack_logfile = os.popen(locate logfile | grep | nethackdir).read() | | and I'm wanting a Windows equivalent, any suestions? Well, you could obviously use os.walk

Re: Needing a WinXP Python variant of a line of code

2006-01-30 Thread Ron Rogers Jr.
]) exit Thank you. I guess I should do more reading, since I hadn't read about os.walk yet. I shouldn't even be trying to do what I'm doing so early in my learning. It will eventually be a Nethack logfile parse script. CronoCloud (Ron Rogers Jr.) -- http://mail.python.org/mailman/listinfo

Re: beta.python.org content

2006-01-28 Thread Ron Rogers Jr.
very new to Python. CronoCloud (Ron Rogers Jr.) -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with documentation

2006-01-28 Thread Ron Rogers Jr.
help assertion would not work, but help ASSERTION will. Just figured this out myself, yesterday. CronoCloud (Ron Rogers Jr.) -- http://mail.python.org/mailman/listinfo/python-list

cgi script error

2006-01-19 Thread Ron Griswold
, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

HTML library

2006-01-17 Thread Ron Griswold
the other way ;) Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: HTML library

2006-01-17 Thread Ron Griswold
Hi Cliff, Looks like xist is exactly what I'm looking for. Thank you, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: Cliff Wells [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 17, 2006 9:33 AM To: Ron Griswold Cc: python-list@python.org Subject

Restarting scripts

2006-01-16 Thread Ron Griswold
with python code, or third party software, Id love to hear about it. Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Restarting scripts

2006-01-16 Thread Ron Griswold
the server is opening is already in use (even on the first try). Does anyone know of a nice reliable app that already does this for you? Open source preferably. Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED

RE: Creating shortcuts?

2006-01-13 Thread Ron Griswold
not appear in a windows directory listing, not that I really want it to. As for os.link and os.symlink, these appear to be unix specific. It would be nice if os.symlink, when run on windows, would create a shortcut. Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message

RE: Creating shortcuts?

2006-01-13 Thread Ron Griswold
Hi Roger, Thank you, I will look into this. Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roger Upole Sent: Friday, January 13, 2006 4:59 AM To: python-list@python.org Subject: Re: Creating

RE: Converting a string to an array?

2006-01-12 Thread Ron Griswold
Does this do what you are looking for? s = 'abcdefg'; a = []; a += s; a; ['a', 'b', 'c', 'd', 'e', 'f', 'g'] Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Chase Sent: Thursday, January

Creating shortcuts?

2006-01-12 Thread Ron Griswold
Hi Folks, Is it possible to create a shortcut to a file in Python? I need to do this in both win32 and OSX. I've already got it covered in Linux by system(ln...). Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: how to improve this simple block of code

2006-01-11 Thread Ron Griswold
How 'bout: X = 132.00; Y = int(float(X)); Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mel Wilson Sent: Wednesday, January 11, 2006 1:08 PM To: python-list@python.org Subject: Re: how

Re: Regex anomaly

2006-01-03 Thread Ron Garret
In article [EMAIL PROTECTED], Roy Smith [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Sam Pointon [EMAIL PROTECTED] wrote: Would this particular inconsistency be candidate for change in Py3k? Seems to me the pos and endpos arguments are redundant with slicing, and the

Python newbie needs help

2005-12-14 Thread Ron Hudson
First let me apologize if this post offends, I am a real newbie to Python having only used it for about 2 days. If this is the wrong place to post newbie questions, please be polite. I have the O'Reily Learning Python book and I am reading it. Here's what I am working on.. I am trying to

RE: 0 in [True,False] returns True

2005-12-13 Thread Ron Griswold
False Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

apply()?

2005-12-05 Thread Ron Griswold
appear to be the case. Can someone point me in the right direction? Thanks, Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: apply()?

2005-12-05 Thread Ron Griswold
Just the ticket. Thank you! Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fredrik Lundh Sent: Monday, December 05, 2005 3:58 PM To: python-list@python.org Subject: Re: apply()? Ron Griswold

Application Plugin Framework

2005-11-21 Thread Ron
Hello, I'm attempting to develop a plugin framework for an application that I'm working on. I wish to develop something in which all plugins exist in a directory tree. The framework need only be given the root of the tree. The framework then uses os.path.walk to search all for all files

Tix BUG? Where to submit?

2005-11-14 Thread Ron
to have it considered that this be added to Tix? Thanks for your help. Ron Provost -- http://mail.python.org/mailman/listinfo/python-list

Re: help make it faster please

2005-11-13 Thread Ron Adam
one is faster depends on the average word length and number of ignored characters. Cheers, Ron Character count: 10 Word count: 16477 Average word size: 6.06906597075 word_counter: 0.06820057 (best of 3) count_words: 0.07333837 (best of 3) # import string import re import

Re: help make it faster please

2005-11-13 Thread Ron Adam
Fredrik Lundh wrote: Ron Adam wrote: The \w does make a small difference, but not as much as I expected. that's probably because your benchmark has a lot of dubious overhead: I think it does what the OP described, but that may not be what he really needs. Although the test to find

Re: How to convert a number to hex number?

2005-11-09 Thread Ron Adam
Bengt Richter wrote: On Wed, 09 Nov 2005 00:42:45 GMT, Ron Adam [EMAIL PROTECTED] wrote: Bengt Richter wrote: On 08 Nov 2005 08:07:34 -0800, Paul Rubin http://[EMAIL PROTECTED] wrote: dcrespo [EMAIL PROTECTED] writes: hex(255)[2:] 'ff' '%x'%255 is preferable since the format of hex

Re: How to convert a number to hex number?

2005-11-08 Thread Ron Adam
not sure what the best behavior should be for it, but iterating a string is faster than converting to int and back. I doubt I can make these significantly faster at this point. Using dictionary lookups really helped a lot going both ways. Cheers, Ron import string BaseDigits = sorted(list

Re: which feature of python do you like most?

2005-11-08 Thread Ron Adam
[EMAIL PROTECTED] wrote: which feature of python do you like most? I've heard from people that python is very useful. Many people switch from perl to python because they like it more. I am quite familiar with perl, I've don't lots of code in perl. Now, I was curious and interested in

Re: Tkinter- Building a message box

2005-11-07 Thread Ron Adam
and sometimes modify the values to the dialog and then return the dialog.result value after it's closed. Something like... def domydialog(*args, **kwds): # # Check and modify args or kwds here if needed. # mydialog(*args, **kwds) return mydialog.result Cheers, Ron -- http

Re: Tkinter- Building a message box

2005-11-07 Thread Ron Adam
domydialog(*args, **kwds): # # check or change args or kwds # d = mydialog(*args, **kwds) return d.result I left out the returned object name 'd'. Which is needed to get the result from the dialog instance. Cheers, Ron -- http://mail.python.org/mailman/listinfo

Re: when and how do you use Self?

2005-11-07 Thread Ron Adam
= a + b This should be enough to visualize the basic relationship. Hope it helped. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Ron Adam
until you decide how else to do it. You can easily write the dictionaries to a text file in the chosen format later and that will tell you what you need to do to read the file back into the dictionaries as it will just be reversed. Cheers, Ron -- http://mail.python.org/mailman/listinfo

Re: overloading *something

2005-11-07 Thread Ron Adam
, and iter. What is it if not one of these? And, how about the **something operator? James A dictionary would be pretty much the same except subclassed from a dictionary of course. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning a value from a Tk dialog

2005-11-07 Thread Ron Adam
. The return line above is the same as... cc = Chooser(**options) color = cc.show() return color The other dialogs work in same way. They are all based on tkCommonDialog, so look in tkCommonDialog.py to see exactly what's going on. Cheers, Ron -- http://mail.python.org

Re: overloading *something

2005-11-07 Thread Ron Adam
Alex Martelli wrote: Ron Adam [EMAIL PROTECTED] wrote: James Stroud wrote: And, how about the **something operator? James A dictionary would be pretty much the same except subclassed from a dictionary of course. I believe this one is correct (but I have not checked in-depth

Re: dictionary that have functions with arguments

2005-11-02 Thread Ron Adam
) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary that have functions with arguments

2005-11-02 Thread Ron Adam
Neal Norwitz wrote: Ron Adam wrote: Eval or exec aren't needed. Normally you would just do... execfunc['key1'](**args) If your arguments are stored ahead of time with your function... Committed revision 41366. Committed revision 41366 ? You could then do... func, args

Re: Arguments for button command via Tkinter?

2005-10-31 Thread Ron Adam
(): self.exit(event=id) return do_command In this case it's a dialog button so it calls the exit method which sets self.return to the button id before exiting. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Would there be support for a more general cmp/__cmp__

2005-10-28 Thread Ron Adam
Antoon Pardon wrote: Op 2005-10-26, Ron Adam schreef [EMAIL PROTECTED]: Adding complexity to cmp may not break code, but it could probably slow down sorting in general. So I would think what ever improvements or alternatives needs to be careful not to slow down existing sorting cases

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Ron Adam
Tkinter color string. return '#%02x%02x%02x' % (red, green, blue) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Ron Adam
particularly wrong with the program that might cause the problem you are referring to. So I'm afraid I can't help much. Maybe someone with 2.3 can reproduce it? BTW, Nice puzzle, much harder than it looks. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Top-quoting defined [was: namespace dictionaries ok?]

2005-10-26 Thread Ron Adam
the arguments. Probably I should have equally lambasted Ron for the heinous crime of bottom-quoting. I usually try to keep things in reasonable context and or order. I tend to bottom quote only when either the message is short enough to fit on a single page, or when I'm adding new content

Re: Would there be support for a more general cmp/__cmp__

2005-10-26 Thread Ron Adam
not to slow down existing sorting cases. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-26 Thread Ron Adam
(or search path) with the same name as the directory or file they are in, you could be importing the wrong file and then not be finding the sub modules. Like I said this is a guess, but I thought it might be worth mentioning if nothing else to rule out file path problems like these. Cheers, Ron

Re: How best to reference parameters.

2005-10-26 Thread Ron Adam
-- 0 print c_y.p2.ptype-- 'ob1' print c_y.p2.number -- 1 etc... print c_y.showall() Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: How best to reference parameters.

2005-10-26 Thread Ron Adam
David Poundall wrote: Sadly Ron, c_y can only see index and showall in your example. Well, don't give up! The approach is sound and I did say it was untested. Here's a tested version with a few corrections. :-) Cheers, Ron class Pump(object): def __init__(self, name, ptype

Re: namespace dictionaries ok?

2005-10-26 Thread Ron Adam
Alex Martelli wrote: Ron Adam [EMAIL PROTECTED] wrote: ... class namespace(dict): def __getattr__(self, name): return self.__getitem__(name) ... Any thoughts? Any better way to do this? If any of the keys (which become attributes through

Re: namespace dictionaries ok?

2005-10-25 Thread Ron Adam
of creating a new object? Cheers, Ron On Monday 24 October 2005 19:53, Ron Adam wrote: James Stroud wrote: Here it goes with a little less overhead: py class namespace: ... def __init__(self, adict): ... self.__dict__.update(adict) ... py n = namespace({'bob':1, 'carol':2, 'ted':3, 'alice

Re: namespace dictionaries ok?

2005-10-25 Thread Ron Adam
(dict): __getattr__ = dict.__getitem__ __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ This seems to work, and eliminates the indirect method calls. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: namespace dictionaries ok?

2005-10-25 Thread Ron Adam
Duncan Booth wrote: Ron Adam wrote: James Stroud wrote: Here it goes with a little less overhead: example snipped But it's not a dictionary anymore so you can't use it in the same places you would use a dictionary. foo(**n) Would raise an error. So I couldn't do: def foo

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-25 Thread Ron Adam
you are using. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: namespace dictionaries ok?

2005-10-25 Thread Ron Adam
Bengt Richter wrote: On Tue, 25 Oct 2005 16:20:21 GMT, Ron Adam [EMAIL PROTECTED] wrote: Or worse, the dictionary would become not functional depending on what methods were masked. And this approach reverses that, The dict values will be masked by the methods, so the values can't effect

Re: Setting Class Attributes

2005-10-25 Thread Ron Adam
objects that were bound to names when the class was defined. They don't share any objects that get bound to instance attribute names in methods later. Does this help any? Cheers, Ron (hopefully, reasons will help me remeber why things are the way they are, so I don't forget

namespace dictionaries ok?

2005-10-24 Thread Ron Adam
awkward to have to use string keys in this situation. This is easy and still retains the dictionary so it can be modified and passed to another function or method as kwds again. Any thoughts? Any better way to do this? Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: namespace dictionaries ok?

2005-10-24 Thread Ron Adam
you can't use it in the same places you would use a dictionary. foo(**n) Would raise an error. So I couldn't do: def foo(**kwds): kwds = namespace(kwds) kwds.bob = 3 kwds.alice = 5 ... bar(**kwds) #--- do something with changed items Ron

Re: namespace dictionaries ok?

2005-10-24 Thread Ron Adam
what you were referring to at first. But yes, I see the similarity. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to replace first word in string?

2005-10-22 Thread Ron Adam
Steven D'Aprano wrote: def replace_word(source, newword): Replace the first word of source with newword. return newword + + .join(source.split(None, 1)[1:]) import time def test(): t = time.time() for i in range(1): s = replace_word(aa to become, /aa/)

Re: Question about inheritance...

2005-10-22 Thread Ron Adam
. Could you explain a little better what you are doing. Since I'm working on the same (or similar) thing maybe we can share our results, (or efforts). Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to replace first word in string?

2005-10-22 Thread Ron Adam
Steven D'Aprano wrote: On Sat, 22 Oct 2005 21:41:58 +, Ron Adam wrote: Don't forget a string can be sliced. In this case testing before you leap is a win. ;-) Not much of a win: only a factor of two, and unlikely to hold in all cases. Imagine trying it on *really long* strings

Re: Question about inheritance...

2005-10-22 Thread Ron Adam
, and easier to create SVG files as well, as it closes the gap between the canvas object and the VGA standard. Anyway, I'm more than willing to get involved in a group to do this if anyone is interested and also thinks it may be worth while. Cheers, Ron -- http://mail.python.org

Re: best way to replace first word in string?

2005-10-22 Thread Ron Adam
[EMAIL PROTECTED] wrote: interesting. seems that if ' ' in source: is a highly optimized code as it is even faster than if str.find(' ') != -1:' when I assume they end up in the same C loops ? The 'in' version doesn't call a function and has a simpler compare. I would think both of those

Re: classmethods, class variables and subclassing

2005-10-21 Thread Ron Adam
the states because the list isn't ever reassigned after it's created, so the values in it can change and all instances and subclasses can see the changed values. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: destroy your self????

2005-10-20 Thread Ron Adam
James wrote: Doesn't work for classes because self has no global reference. True. To make it work one would need to track instances and names and do comparisons... and so on. So it's not worth it. ;-) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: question about timestamp and MySQLdb

2005-10-19 Thread Ron Garret
In article [EMAIL PROTECTED], Sean Berry [EMAIL PROTECTED] wrote: I am using MySQLdb to connect to a database and retrieve a timestamp from a table. The problem is I want the timestamp as a long, unformatted and all. In the table I have a timestamp like this 20051019111617 But, when I

multi-property groups?

2005-10-19 Thread Ron Adam
to do it. So is there a better way? Is there a way to use properties to do this same thing? I'd also like a way to override the dictionary methods __getitem__, __setitem__, and __delitem__. (Or an equivalent) Cheers, Ron class Pobject(object): an objects class that can have

Re: multi-property groups?

2005-10-19 Thread Ron Adam
This is what I like about Python, there's almost always a way to do it. ;-) Here's an updated version that I think works, but it could use some review. Any way to make this better? Should grouped properties share references to objects? Cheers, Ron Grouped properties: This need

Re: destroy your self????

2005-10-19 Thread Ron Adam
, in ? NameError: name 'foo' is not defined Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Vim capable IDE?

2005-10-18 Thread Ron Adam
looking for. I think most Vim users just add what they want to Vim. Here's what I use to launch a script and capture the output into a read only panel. I think it may still needs a little fine tuning. This is on windows, but it should work on linux with some minor changes. Cheers, Ron Add

Tkinter or Python issue?

2005-10-18 Thread Ron Provost
in different behavior? Is it a Python thing or a Tkinter thing? Thanks for your feedback. Ron -- http://mail.python.org/mailman/listinfo/python-list

NYLUG meeting: 10/26 The Python Object Model with Alex Martelli Google (slight correction)

2005-10-17 Thread Ron Guerin
the tab for an hour and a half of open bar and food. Additionally, if you're looking for a job as a Python developer, bring your resume. Please RSVP at http://rsvp.nylug.org to attend, as seating is limited. PS: You may wish to bring ID and a GPG fingerprint to sign keys. - Ron (announcement

NYLUG meeting: 10/26 The Python Object Model with Alex Martelli Google (open bar and food!)

2005-10-17 Thread Ron Guerin
the tab for an hour and a half of open bar and food. Additionally, if you're looking for a job as a Python developer, bring your resume. Please RSVP at http://rsvp.nylug.org to attend, as seating is limited. PS: You may wish to bring ID and a GPG fingerprint for keysigning. - Ron (announcement

ordered keywords?

2005-10-17 Thread Ron Adam
formats where you have definitions before expressions. If I use keywords only, It won't keep the order, and if I use args before keywords, I have to pre-assign temporary 'None' values to the arguments in the parent or global scope. Any ideas? Cheers, Ron -- http

Re: ordered keywords?

2005-10-17 Thread Ron Adam
Diez B. Roggisch wrote: Ron Adam wrote: Is there a way to preserve or capture the order which keywords are given? def foo(**kwds): ...print kwds ... foo(one=1, two=2, three=3) {'three': 3, 'two': 2, 'one': 1} I would love to reverse the *args, and **kwds as well so I can use

Re: ordered keywords?

2005-10-17 Thread Ron Adam
Ron Adam wrote: def lamb(args): for v in args: print v def feedlamb(): print locals() y = 20 lamb( (lambda x=10: (x,y,x+y))() ) print locals() feedlamb() {} 10 20 30 {'y': 20} Cool, this is the exact behavior I was thinking of, but without

Re: ordered keywords?

2005-10-17 Thread Ron Adam
Kent Johnson wrote: Ron Adam wrote: drawshapes( triangle=3, square=4, color=red, polygon(triangle, color), polygon(square, color) ) This comes close to the same pattern used in SVG and other formats where you have definitions before expressions. Why

Re: dis.dis question

2005-10-16 Thread Ron Adam
Bengt Richter wrote: On Sun, 09 Oct 2005 12:10:46 GMT, Ron Adam [EMAIL PROTECTED] wrote: Ron Adam wrote: It seems I've found a bug in dis.py, or maybe a expected non feature. When running dis from a program it fails to find the last traceback because sys.last_traceback doesn't get set

Re: dis.dis question

2005-10-16 Thread Ron Adam
') 0 LOAD_CONST 1 (1) 3 PRINT_ITEM 4 PRINT_NEWLINE 5 LOAD_CONST 0 (0) 8 RETURN_VALUE It works! :-) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing lists

2005-10-16 Thread Ron Adam
if they need to. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing lists

2005-10-16 Thread Ron Adam
Christian Stapfer wrote: Ron Adam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer wrote: This discussion begins to sound like the recurring arguments one hears between theoretical and experimental physicists. Experimentalists tend to overrate the importance

Re: Comparing lists - somewhat OT, but still ...

2005-10-16 Thread Ron Adam
the outcome. So the you could say: don't *depend* on the completeness of your theoretical information, try to *verify* the validity of your results with experiments. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing lists

2005-10-16 Thread Ron Adam
Christian Stapfer wrote: Ron Adam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer wrote: Ron Adam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christian Stapfer wrote: This discussion begins to sound like the recurring arguments one hears between

tkinter drawing

2005-10-15 Thread Ron Adam
know what you think? Some of the things I want to add, but aren't exactly sure how at this time: Nested groups Use tags to be able to change sub items later Have items get attribues from the group if it doesn't have them Hope this isn't too long. Cheers, Ron Tkinter Color Vector

NYLUG meeting: The Python Object Model with Alex Martelli Google (open bar and food!)

2005-10-14 Thread Ron Guerin
. Additionally, if you're looking for a job as a Python developer, bring your resume. Please RSVP at http://rsvp.nylug.org to attend, as seating is limited. - Ron (announcement follows) The New York Linux User's Group Presents Alex Martelli

Re: NYLUG meeting: The Python Object Model with Alex Martelli Google(open bar and food!)

2005-10-14 Thread Ron Guerin
George Sakkis wrote: What date is it ? It isn't mentioned at the web site either. Sorry about that, actually it is on the web site, right at the top in the blue band. October 26, 2005 6:00pm - 10:00pm Hope to see you there. - Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: NYLUG meeting: The Python Object Model with Alex Martelli Google(open bar and food!)

2005-10-14 Thread Ron Guerin
Gregory PiƱero wrote: A reasonable question ... Sure is. ;) October 26, 2005 6:00pm - 10:00pm - Ron -- http://mail.python.org/mailman/listinfo/python-list

object inheritance and default values

2005-10-14 Thread Ron Adam
alike? Hmmm.. I think maybe if if don't ever access shape (or Shape) directly in my data structure, then __new__ would work? So my first default object should be an instance of shape with a __new__ method to create more? Ok, off to try it. But any comments will be welcome. Cheers, Ron

Re: object inheritance and default values

2005-10-14 Thread Ron Adam
George Sakkis wrote: Ron Adam [EMAIL PROTECTED] wrote: I'm trying to implement simple svg style colored complex objects in tkinter and want to be able to inherit default values from other previously defined objects. I want to something roughly similar to ... class shape(object

Setdefault bypasses __setitem__

2005-10-13 Thread Ron Garret
Is this a bug or a feature? class mydict(dict): def __setitem__(self, key, val): print 'foo' dict.__setitem__(self, key, val) d=mydict() d[1]=2 foo d.setdefault(2,3) 3 rg -- http://mail.python.org/mailman/listinfo/python-list

Re: non descriptive error

2005-10-12 Thread Ron Adam
): File gen.py, line 26, in ? raise your error Error: your error Hope this helps, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: dis.dis question

2005-10-09 Thread Ron Adam
Ron Adam wrote: Can anyone show me an example of of using dis() with a traceback? Examples of using disassemble_string() and distb() separately if possible would be nice also. [cliped] But I still need to rewrite disassemble_string() and need to test it with tracebacks. Cheers

Re: Function decorator that caches function results

2005-10-09 Thread Ron Adam
, 'cache' and 'fn' are replaced by the objects they reference before the cached_result function is returned. Is this correct? Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Function decorator that caches function results

2005-10-09 Thread Ron Adam
Fredrik Lundh wrote: Ron Adam wrote: In effect, 'cache' and 'fn' are replaced by the objects they reference before the cached_result function is returned. not really; accesses to free variables always go via special cell objects (rather than direct object references), and the compiler

Re: non descriptive error

2005-10-09 Thread Ron Adam
idea of what's going on. Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's Performance

2005-10-09 Thread Ron Adam
out where to start. If I was forced to go back to MS C++ again, I think I would take up painting instead of programing as my main hobby. ;-) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   9   10   >