encing newfunc, then everything should be
freed.
Thanks,
GZ
--
http://mail.python.org/mailman/listinfo/python-list
)==(not c), but I think this code has
other issues, for example, when a=[] and c=['a'], the assertion will
fail, although a is not None.
So how do I reliably test if a value is None or not?
Thanks,
gz
--
http://mail.python.org/mailman/listinfo/python-list
I see. Thanks for the clarification.
On Dec 22, 12:35 am, Steven D'Aprano wrote:
> On Wed, 21 Dec 2011 21:45:13 -0800, GZ wrote:
> > Now the question here is this:
>
> > def h():
> > if condition=true:
> > #I would like to return an iter
met, I want to yield
nothing. How to do?
Thanks,
gz
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
On Nov 21, 7:42 am, ray wrote:
> I don't see how to get my data from the output. I can see the data in
> the rows but it is mixed in with the field names. That is, the data I
> get comes out as:
> fieldname1 : data1 , fieldname2 : data2 , etc.
>
> import csv
> linelist=open( "C:/Users/me/li
etter way of handling such situation?
Thanks,
gz
--
http://mail.python.org/mailman/listinfo/python-list
Hi All,
I see. It works.
Thanks,
GZ
On Nov 18, 12:04 pm, Ian Kelly wrote:
> On Fri, Nov 18, 2011 at 7:51 AM, GZ wrote:
> > Hi,
>
> > I have a class Record and a list key_attrs that specifies the names of
> > all attributes that correspond to a primary key.
>
>
A','B'], I want the generated function to
be equivalent to the following:
def get_key(instance_of_record):
return (instance_of_record['A'],instance_of_record['B'] )
I realize I can use eval or exec to do this. But is there any other
way to do this?
Thanks,
g
On Aug 14, 12:07 pm, Thomas Jollans wrote:
> On Saturday 14 August 2010, it occurred to GZ to exclaim:
>
> > Hi All,
>
> > I am writing a little program that reads the minidom tree built from
> > an xml file. I would like to print out the line number of the xml file
&
help?
Thanks,
gz
--
http://mail.python.org/mailman/listinfo/python-list
Hi Alex,
On Aug 7, 6:54 pm, Alex Willmer wrote:
> On Aug 7, 5:26 pm, GZ wrote:
>
> > I am wondering if there is a module that can persist a stream of
> > objects without having to load everything into memory. (For this
> > reason, I think Pickle is out, too, because i
data. In essence, shelve.keys() takes
forever.
I am wondering if there is a module that can persist a stream of
objects without having to load everything into memory. (For this
reason, I think Pickle is out, too, because it needs everything to be
in memory.)
Thanks,
GZ
--
http://mail.python.org
On Jun 5, 8:42 pm, Ben Finney wrote:
> GZ writes:
> > Let me think of a better way to express what I mean by a "smaller
> >diff." After Idiffthe two strings, I will have something like this:
>
> > AAA
> > - BBB
> > + CCC
> > + DDD
> >
Hi Lie,
On Jun 5, 2:53 am, Lie Ryan wrote:
> On 06/05/10 15:43, GZ wrote:
>
>
>
>
>
> > On Jun 4, 8:37 pm, Lie Ryan wrote:
> >> On06/05/10 07:51, GZ wrote:
> >>> No, rsync does not solve my problem.
>
> >>> I want a library that do
Hi,
I am looking for a fast internal vector representation so that
(a1,b2,c1)+(a2,b2,c2)=(a1+a2,b1+b2,c1+c2).
So I have a list
l = ['a'a,'bb','ca','de'...]
I want to count all items that start with an 'a', 'b', and 'c'.
What I can do is:
count_a = sum(int(x[1]=='a') for x in l)
count_b = sum(
On Jun 4, 8:37 pm, Lie Ryan wrote:
> On06/05/10 07:51, GZ wrote:
>
>
>
>
>
> > Hi Pat,
>
> > On Jun 4, 2:55 pm, Patrick Maupin wrote:
> >> On Jun 3, 9:54 pm, GZ wrote:
>
> >>> Hi All,
>
> >>> I am looking for an algorit
Hi Pat,
On Jun 4, 2:55 pm, Patrick Maupin wrote:
> On Jun 3, 9:54 pm, GZ wrote:
>
> > Hi All,
>
> > I am looking for an algorithm that can compare to source code files
> > line by line and find the minimum diff. I have looked at the difflib
> > included in
differencial. I would like an algorithm implementation
that gives the absolute minimum difference between the two files.
Can you help me?
Thanks,
gz
--
http://mail.python.org/mailman/listinfo/python-list
Hi All,
I am looking at the following code:
def fn():
def inner(x):
return tbl[x]
tbl={1:'A', 2:'B'}
f1 = inner # I want to make a frozen copy of the values of tbl
in f1
tbl={1:'C', 2:'D'}
f2 = inner
return (f1,f2)
f1,f2 = fn()
f1(1) # output C
f2(1) # output
On Apr 28, 1:20 am, Chris Rebert wrote:
> On Tue, Apr 27, 2010 at 11:02 PM, GZ wrote:
> > On Apr 27, 9:20 pm, alex23 wrote:
> >> GZ wrote:
> >> > I do not think it will help me. I am not trying to define a function
> >> > fn() in the class, but rath
On Apr 27, 9:20 pm, alex23 wrote:
> GZ wrote:
> > I do not think it will help me. I am not trying to define a function
> > fn() in the class, but rather I want to make it a "function reference"
> > so that I can initialize it any way I like later.
>
> It a
On Apr 27, 9:20 pm, alex23 wrote:
> GZ wrote:
> > I do not think it will help me. I am not trying to define a function
> > fn() in the class, but rather I want to make it a "function reference"
> > so that I can initialize it any way I like later.
>
> It a
Hi Chris,
On Apr 27, 6:43 pm, Chris Rebert wrote:
> On Tue, Apr 27, 2010 at 4:36 PM, GZ wrote:
> > I want to store a reference to a function into a class property.
>
> > So I am expecting that:
>
> > class A:
> > fn = lambda x: x
>
> > fn = A.fn
&
t instance instead)
The problem is that A.fn is treated as a bounded method. I really want
A.fn to be a variable that stores a reference to a function. Is there
any way to achieve this?
Thanks,
GZ
--
http://mail.python.org/mailman/listinfo/python-list
no, I don't have them... I need them :)
I'd like to thank Giovanni Bajo for providing binaries for the various
package dependencies, and geting me going with pyopengl.
Unfortunately I only menaged to run a basic example, where there's no
animation. The glwindow only get's redrawn when it's resize
Hi!
I wanted to use python to test a simple character device (on linux) and
I'm running into strange behaviour of read..
I have a short buffer inside my device and the idea is that it blocks
read's when the buffer is empty. For reads that ask for more characters
that the buffer holds the device sh
26 matches
Mail list logo