how do I put the python on my desktop or even access it

2016-01-17 Thread zack fitzsimons
Sent from Windows Mail -- https://mail.python.org/mailman/listinfo/python-list

exec within function

2010-02-03 Thread Simon zack
hi, I'm not sure how I can use exec within a function correctly here is the code i'm using: def a(): exec('b=1') print(b) a() this will raise an error, but I would like to see it outputting 1 thanks smk -- http://mail.python.org/mailman/listinfo/python-list

Re: Accumulating values in dictionary

2008-05-20 Thread Zack
On May 20, 10:38 am, Thomas Bellman <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > from collections import defaultdict > > d = defaultdict(int) # That means the default value will be 0 > > for person in people: > > d[person.fav_food] += 1 > > Ah! I didn't think of

Re: Accumulating values in dictionary

2008-05-20 Thread Zack
On May 20, 12:26 pm, Zack <[EMAIL PROTECTED]> wrote: > Given a bunch of objects that all have a certain property, I'd like to > accumulate the totals of how many of the objects property is a certain > value. Here's a more intelligible example: > > Users all have on

Accumulating values in dictionary

2008-05-20 Thread Zack
Given a bunch of objects that all have a certain property, I'd like to accumulate the totals of how many of the objects property is a certain value. Here's a more intelligible example: Users all have one favorite food. Let's create a dictionary of favorite foods as the keys and how many people hav

Re: class static variables and __dict__

2008-02-16 Thread Zack
Dustan wrote: > On Feb 16, 5:59 pm, Zack <[EMAIL PROTECTED]> wrote: >> Zack wrote: >>> Diez B. Roggisch wrote: >>>> Zack schrieb: >>>>> If I have a class static variable it doesn't show up in the __dict__ >>>>> of an instance o

Re: class static variables and __dict__

2008-02-16 Thread Zack
Dustan wrote: > On Feb 16, 4:40 pm, Zack <[EMAIL PROTECTED]> wrote: >> what method can you use on x to find all available >> attributes for that class? > >>>> class Foo(object): > bar = "hello, world!" > def __init__(self, baz

Re: class static variables and __dict__

2008-02-16 Thread Zack
Zack wrote: > Diez B. Roggisch wrote: >> Zack schrieb: >>> If I have a class static variable it doesn't show up in the __dict__ >>> of an instance of that class. >>> >>> class C: >>>n = 4 >>> >>> x = C() >>>

Re: class static variables and __dict__

2008-02-16 Thread Zack
Diez B. Roggisch wrote: > Zack schrieb: >> If I have a class static variable it doesn't show up in the __dict__ >> of an instance of that class. >> >> class C: >>n = 4 >> >> x = C() >> print C.__dict__ >> {'__module__': &

class static variables and __dict__

2008-02-16 Thread Zack
s n is not encapsulated in x's namespace but what method can you use on x to find all available attributes for that class? -- Zack -- http://mail.python.org/mailman/listinfo/python-list

Re: Critique of first python code

2008-02-08 Thread Zack
''' counter = 0 while seq: below = [] for item in seq: if hasattr(item, '__iter__'): below.extend(item) else: print item, counter += 1 #intentional blank line to distinguish long lines that wrap print '\n' seq = below return counter L = grow([],10) C = traverse(L) -- Zack -- http://mail.python.org/mailman/listinfo/python-list

Critique of first python code

2008-02-08 Thread Zack
on iterables in L.''' if L == []: return count n = [] for e in L: if not hasattr(e,'__iter__'): print e, count += 1 else: n[:] += e print '\n' return traverse(n,count) L = grow([],10) C = traverse(

RE: Build spoofed IP packets

2005-10-06 Thread Payton, Zack
See scapy.py I've completed windows support at this time and am currently testing it, working out some bugs. If you want a copy just ask. I need some testers. It can do almost any packet transmissions you want. (google it) Z -- http://mail.python.org/mailman/listinfo/python-list

Os.fork() replacement for windows.

2005-09-22 Thread Payton, Zack
ething I'd prefer to avoid if there is a better solution available.  Any ideas?  Thanks so much, Zack Payton -- http://mail.python.org/mailman/listinfo/python-list