Re: Build spoofed IP packets

2005-10-05 Thread Eric Nieuwland
billie wrote: > Traceback (most recent call last): > File "C:\test\client.py", line 156, in ? > send_pkt() > File "C:\test\client.py", line 96, in send_pkt > s.sendto(ip.get_packet(), (dst, 0)) # send packet to server > socket.error: (10004, 'Interrupted system call') > > Note: this onl

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-07 Thread Eric Nieuwland
Robin Becker wrote: > As mentioned earlier only a dictator can make such decisions and of > course as > with many dictatorships the wrong decision is often made. There's no > such thing > as a benevolent dictatorship. Ever cared to check what committees can do to a language ;-) --eric -- htt

Re: Lambda evaluation

2005-10-07 Thread Eric Nieuwland
Joshua Ginsberg wrote: > Try this one: > d = {} for x in [1,2,3]: > ... d[x] = lambda *args: args[0]*x > ... d[1](3) try it with: d[x] = (lambda x=x: (lambda *args: args[0]*x))() the outer lambda fixes the value of x and produces the inner lambda with the fixed x value

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-10 Thread Eric Nieuwland
Dave Hansen wrote: > And Basic, and Fortran, and Lisp, and just about any programming > language you care to name, including python (if Condition: Affirmative > else: Negative). > > Not to mention that the sequence is identical to execution order. > It's just plain goofy to have to scan to the midd

Re: Class Variable Access and Assignment

2005-11-03 Thread Eric Nieuwland
Graham wrote: > > > class _class: > var = 0 > #rest of the class > > instance_b = _class() > > _class.var=5 > > print instance_b.var # -> 5 > print _class.var # -> 5 > > > [...] > > > instance_b.var = 1000 # -> _class.var = 5 > _class.var = # -> _

Re: Class Variable Access and Assignment

2005-11-03 Thread Eric Nieuwland
Stefan Arentz wrote: > It is really simple. When you say b.a then the instance variable 'a' > is looked up first. If it does not exist then a class variable lookup > is done. This mixing of class and instance variable might be the cause of confusion... I think of it as follows: 1 When the class

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Eric Nieuwland
Stuart Turner wrote: > "Python is a scripting language like Perl, awk, tcl, Java etc...  it > is > not quite a fully developed OO language, but does support some OO that > Perl > doesn't.  To be clear, these scripting languages have their place in > our > environment, but they are not full repl

Re: Class Variable Access and Assignment

2005-11-03 Thread Eric Nieuwland
Steven D'Aprano wrote: > On Thu, 03 Nov 2005 15:13:52 +0100, Eric Nieuwland wrote: >> 2 When an instance of the class is created, what effectively happens >> is >> that a shallow copy of the class object is made. >> Simple values and object references are copi

Re: FTP over SSL (explicit encryption)

2005-08-10 Thread Eric Nieuwland
David Isaac wrote: > I am looking for a pure Python secure ftp solution. > Does it exist? Do you want SFTP or FTP/S? > I would have thought that the existence of OpenSSL > would imply "yes" but I cannot find anything. > > ftplib does not seem to provide any secure services. Indeed. If you want SFT

Re: Python Wireless Extension Module (pyiw)

2005-08-13 Thread Eric Nieuwland
Jeremy Moles wrote: > I am mostly done with writing an extension module in C that wraps (and > makes easier) interfacing with libiw (the library that powers iwconfig, > iwlist, and friends on Linux). We're using this internally for a tool > to > manage wireless connectivity. This is a million tim

Re: named pipe input

2005-09-01 Thread Eric Nieuwland
max(01)* wrote: > $ cat file_input_3.py > #!/usr/bin/python > > import sys > > MIAPIPE = open("una_pipe", "r") > > for riga in MIAPIPE: >print riga, > ... > [...] > BUT if i try to do the same with the python code, something different > happens: i have to type ALL the lines on console #2 and co

Re: Define Constants

2005-04-20 Thread Eric Nieuwland
codecraig wrote: My directory structure looks like... C:\ --> abc.py --> utils --> __init__.py --> CustomThing.py Ok, CustomThing looks like... TOP = 0 LEFT = 1 class CustomThing: def __init__(self): self.foo = "foo" so, from abc.py I have from utils.Custom

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Eric Nieuwland
Hi Greg, > values = {'request':xml_request} > headers = { 'Referer' : 'YourCompany', > 'Host':'https://gatewaybeta.fedex.com/GatewayDC', > 'Accept':'image/gif, image/jpeg, image/pjpeg, text/plain, > text/html, */*', > 'Content-Type':'image/gif' > }

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Eric Nieuwland
Don't forget to substitute the actual Content-length for %d! --eric On 1 feb 2006, at 17:34, Gregory Piñero wrote: > Correction: > --- > -- > POST /GatewayDC HTTP/1.0 > Referer: YourCompanyNameGoesHere > Host: SSLserver.fedex.c

Re: python printout format

2006-02-01 Thread Eric Nieuwland
Yong, Are you sure you indent with the same characters and there is no non-print code there? --eric On 1 feb 2006, at 17:36, Yong Wang wrote: > Hi, >I have a data set like row = [[1,2,3,4,5], [6,7,8,9,10], > [11,12,13,14,15]] >when I use loop to print out data, I got compile error in

Re: translating PHP to Python

2006-02-05 Thread Eric Nieuwland
Dave wrote: > class A(object): > def create_child(self): > self.child = B() > self.child.do_stuff(self) > > class B(object): > def do_stuff(self, parent): > self.parent = parent > if self.parent.__class__.__name__ == 'A': > print "I'm a child of a

Re: PEP 354: Enumerations in Python

2006-02-27 Thread Eric Nieuwland
On 27 feb 2006, at 10:13, Tim Chase wrote: >> Uniqueness imposes an odd constraint that you can't have >> synonyms in the set: >> > shades = enum({white:100, grey:50, gray:50, black:0}) > > Blast, I hate responding to my own posts, but as soon as I > hit Send, I noticed the syntax here was bif

plug-ins

2005-05-07 Thread Eric Nieuwland
Hi all, The app I'm working on keeps getting new transforms and I'm tired of adding them by hand. So here it goes: Can anyone provide me with clues/examples/references on how to create a plug-in framework? tx, --eric -- http://mail.python.org/mailman/listinfo/python-list