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
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
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
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
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'
> }
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
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
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
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 = # -> _
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
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
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
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
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
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
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
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
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
18 matches
Mail list logo