Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 2:04 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: my thanks go out to Emile and Mr Hanson for their responses, I think I've found the solution, much shorter as well:     #!/usr/bin/python     import

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 2:29 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 29 Dec 2009 00:28:32 -0300, Joel Davis callmeclaud...@gmail.com   escribió: On Dec 28, 9:37 pm, Joel Davis callmeclaud...@gmail.com wrote: my thanks go out to Emile and Mr Hanson for their responses, I think

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 10:08 am, Steve Holden st...@holdenweb.com wrote: Joel Davis wrote: On Dec 29, 2:04 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: my thanks go out to Emile and Mr Hanson for their responses, I think I've

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 11:21 am, Emile van Sebille em...@fenx.com wrote: On 12/29/2009 7:02 AM Joel Davis said... On Dec 29, 2:29 am, Gabriel Genellinagagsl-...@yahoo.com.ar wrote: I'm sure other limitations apply too -- don't rely on this technique for anything critical. -- Gabriel Genellina

getting name of passed reference

2009-12-28 Thread Joel Davis
I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVar) how would I get the string nwVar from inside of MyFunc? is it possible? --

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
extract_stack(frame,2)[0][3] MyFunc(varPassed) the print statement returns the full function call including parameters as they were written in the script (variable names and all) On Dec 28, 8:10 pm, Emile van Sebille em...@fenx.com wrote: On 12/28/2009 3:54 PM Joel Davis said... I'm just

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
On Dec 28, 8:40 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Mon, 28 Dec 2009 17:27:21 -0800, Joel Davis wrote: For posterity, I figured out a solution:   #!/usr/bin/python   import sys   from traceback import extract_stack   varPassed=varName get   def

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
As far as more positive things are concerned, is anyone aware of what the support for _getframe(1) the way I used it is? Does steven have a newer (or older) version than me, maybe? (2.6.2) it seems like the sort of thing that ought to have pretty uniform behavior, but are their certain calls it

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
On Dec 28, 9:37 pm, Joel Davis callmeclaud...@gmail.com wrote: As far as more positive things are concerned, is anyone aware of what the support for _getframe(1) the way I used it is? Does steven have a newer (or older) version than me, maybe? (2.6.2) it seems like the sort of thing that ought

Partial list comprehensions

2009-12-04 Thread Joel Davis
Is it possible to run a list comprehension over a certain portion of the list? My goals is to be able to run the comprehension on the innermost elements of the list, but leaving the outermost intact. -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial list comprehensions

2009-12-04 Thread Joel Davis
On Dec 4, 3:41 pm, Mensanator mensana...@aol.com wrote: On Dec 4, 2:22 pm, Joel Davis callmeclaud...@gmail.com wrote: Is it possible to run a list comprehension over a certain portion of the list? My goals is to be able to run the comprehension on the innermost elements of the list

Unpacking Tuples

2009-11-30 Thread Joel Davis
I hate to post such a simple Q and A here, but I seriously can't find it anywhere. Python (unsure of starting with which version) enables the remainder of the tuple to be placed in a catch-all, for example: myTuple = (1,2,3,4) varOne, varTwo, *remaindingTuple = myTuple. where the values left

Re: filename of calling function?

2009-11-28 Thread Joel Davis
On Nov 28, 11:40 am, Phlip phlip2...@gmail.com wrote: On Nov 28, 8:19 am, Phlip phlip2...@gmail.com wrote: Consider these two python modules: aa.py def a():     print '?' bb.py   import aa def bb():   aa.a() bb() How do I make the print line emit the filename of

Re: python gui builders

2009-11-17 Thread Joel Davis
On Nov 16, 5:06 am, me not_h...@nowhere.com wrote: Good People I do not write stuff for humans, as it has been my job to remove humans from the loop. But I have to make a front end to a component database where everything was built in Python. I have looked at the Tk stuff that is built into

Re: python simply not scaleable enough for google?

2009-11-12 Thread Joel Davis
On Nov 12, 10:07 am, mcherm mch...@gmail.com wrote: On Nov 11, 7:38 pm, Vincent Manis vma...@telus.net wrote: 1. The statement `Python is slow' doesn't make any sense to me. Python is a programming language; it is implementations that have speed or lack thereof.    [...] 2. A skilled