On Sat, 23 Jul 2005 20:07:25 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote:
>[Raymond Hettinger]
>>>class Cache(dict):
>>> def __init__(self, n, *args, **kwds):
>>> self.n = n
>>> self.queue = collections.deque()
>>> dict.__init__(self, *args, **kwds)
>
>[Bengt Richter]
>> Mi
"Caleb Hattingh" <[EMAIL PROTECTED]> wrote:
>In another
> newsgroup, I could have been flamed for letting Simon know he helped
> more
> than just the OP with his post :)
+1
OP asks, thousands are educated (perhaps).
The group's generosity is greatly appreciated, even if that appreciation
For some commad Linux like (pdbedit) its not possible to supply password
in the command line itself while we add a samba user account into the
SAM database ..
Now I want' to design an AddAccount() method in Python
i.e when we can't do "pdbedit -adduser x%password"
How do I ma
On Sun, 17 Jul 2005 15:42:08 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> Thanks for the nudge. Actually, I know about generator expressions, but
>> at some point I must have misinterpreted some bug in my code to mean
>> that join in particular didn't like generator ex
On Sat, 16 Jul 2005 23:28:02 -0400, "George Sakkis" <[EMAIL PROTECTED]> wrote:
>"Peter Hansen" <[EMAIL PROTECTED]> wrote:
>
>> George Sakkis wrote:
>> > "Peter Hansen" <[EMAIL PROTECTED]> wrote:
>> Where did you learn that, George?
>> >
>> > Actually I first read about this in the Cookbook; t
On 17 Jul 2005 18:32:28 -0700, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
>[George Sakkis]
>> It's only obvious in the sense that _after_ you see this idiom, you can go
>> back to the docs and
>> realize it's not doing something special; OTOH if you haven't seen it, it's
>> not at all the ob
On Sat, 23 Jul 2005 10:59:56 -0400, "Jeffrey E. Forcier" <[EMAIL PROTECTED]>
wrote:
>Thanks for all the additional replies thus far!
>
>Apparently the issue, as stated implicitly or explicitly by most of
>you, is that new-style class instances essentially defer their magic
>methods to the cla
On Sat, 23 Jul 2005 17:51:31 -0600, John Roth wrote:
> I also like to know the number of elements, which seems to make
> sense as len(path). Again, the number of characters in the path seems
> to be utterly useless information - at least, I can't imagine a use for
> it.
There are (were?) operatin
On Sun, 24 Jul 2005 02:09:54 +0300, Thanos Tsouanas wrote:
> On Sat, Jul 23, 2005 at 11:22:21PM +1000, Steven D'Aprano wrote:
>> On Sat, 23 Jul 2005 11:48:27 +0300, Thanos Tsouanas wrote:
>> > Hello.
>> >
>> > I would like to have a quick way to create dicts from object, so that a
>> > call to fo
Soeren Sonnenburg wrote:
> Hi all,
>
> Just having started with python, I feel that simple array operations '*'
> and '+' don't do multiplication/addition but instead extend/join an
> array:
>
> a=[1,2,3]
> >>> b=[4,5,6]
> >>> a+b
> [1, 2, 3, 4, 5, 6]
>
> instead of what I would have expected:
> [5
On Sat, 23 Jul 2005 18:30:02 +0200, Soeren Sonnenburg wrote:
> Hi all,
>
> Just having started with python, I feel that simple array operations '*'
> and '+' don't do multiplication/addition but instead extend/join an
> array:
* and + are not array operations, they are list operations.
Lists in
On Sat, 23 Jul 2005 13:50:36 -0400, Mike Meyer wrote:
>> I don't think this is particularly useful behaviour. How do you use it?
>
> def __str__(self):
> return self._format % self
That doesn't work. It calls self.__str__ recursively until Python halts
the process.
>>> class Thing(d
On Sat, 23 Jul 2005 17:03:08 +0200, Jan Danielsson wrote:
> The problem is that I have initialized the list like this:
>
> self.drawAttr = { blah, blah, blah.. }
> self.storedAttr = [ ]
> for i in range(0, 10):
>self.storedAttr.append(self.drawAttr)
>
>I know what the problem is; they ar
I decide to seperate my data collection routine from my data analysis
and storage program to a seperate process, so I try to use the new
subprocess model in Python 2.4.
The main program spawns the subprocess and receives data from the
pipe. When some event occurs (e.g. the user clicks the 'Stop'
Christopher Subich wrote:
> print '%s returns:', retval
Not that it matters, but this line should be:
print '%s returns:' % func.__name__, retval
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
[on comparing Paths and stings]
> Do you have a use case for the comparison? Paths should be compared only
> with other paths.
I can think of lots, though I don't know that I've used any in my
existing (somewhat limited) code that uses Path, but they all involve
cases
On Sat, 23 Jul 2005 23:31:04 +1000, John Machin wrote:
>>>You don't need the sissy parentheses; '%c' * len(t) % t works just fine :-)
>>
>>
>> Ah, ok. Didn't want to lookup the precedence rules...
>
>
> Look up the precedence rules? Are you aware of any language where * /
> and % _don't_ have
On Sat, 23 Jul 2005 23:26:19 +1000, John Machin wrote:
> Steven D'Aprano wrote:
>
>>
>>
>''.join(map(lambda n: chr(n), (0x73, 0x70, 0x61, 0x6D)))
>>
>> 'spam'
>
> Why the verbal diarrhoea?
One line is hardly verbal diarrhoea.
> What's wrong with the (already posted)
>
> ''.join(map(ch
[Raymond Hettinger]
>>class Cache(dict):
>> def __init__(self, n, *args, **kwds):
>> self.n = n
>> self.queue = collections.deque()
>> dict.__init__(self, *args, **kwds)
[Bengt Richter]
> Minor comment: There is a potential name collision problem for keyword
> n=something,
>
On Saturday 23 July 2005 03:26 am, Steven D'Aprano wrote:
> On Fri, 22 Jul 2005 07:59:42 -0700, scrimp wrote:
> As others have suggested, if you have to deal with PDF files without
> Acrobat, you could use ghostscript. Also pre-installed on many versions
> of Linux, and probably other Unixes as wel
On Sat, 23 Jul 2005 18:30:29 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote:
[...]
>Did it work on a quad face? What about putting in a debug print before places
>you use
>f.normal, e.g.
>assert hasattr(f, 'normal'), 'This "f"\n\n%r\n\ndid not have a
> normal attribute!!' % f
>
>If f.re
Luis P. Mendes wrote:
> I need to build it from the server and also client side.
>
> For the client side I'll be using Python.
>
> But for the server side, I would like to hear some opinions. Is it worth
> learning Php?
If you know Python and don't know PHP, there's little benefit from
spend
Thanos Tsouanas wrote:
> I would like to have a quick way to create dicts from object, so that a
> call to foo['bar'] would return obj.bar.
>
> The following works, but I would prefer to use a built-in way if one
> exists. Is there one?
Maybe I'm not understanding your problem, but have you look
Paolino wrote:
> Little less ugly:
> In [12]:class A(object):
>: def __str__(self):return self.__str__()
>: def str(self):return 'ciao'
>: def setStr(self):self.__str__=self.str
>:
>
> In [13]:a=A()
>
> In [14]:a.setStr()
>
> In [15]:str(a)
> Out[15]:'
Grant Edwards wrote:
> Personally, I don't really like the idea that falling off the
> botton of a function implicitly returns None. It's just not
> explicit enough for me. My preference would be that if the
> function didn't execute a "return" statement, then it didn't
> return anyting and attem
On 7/19/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Is anyone know about a DB form generator unit under wxPython ?
> What that's means ?
>
> I add information about a Query, or a ListOfDict, I set some other infos
> (Lookups, others), and it is generate a Form with edit boxes, listboxes,
>
On 21 Jul 2005 19:29:32 -0700, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
>[Will McGugan]
>> I need a collection class that behaves like a dictionary but when it
>> reaches 'n' items it discards the oldest item so that the length never
>> goes above 'n'. (Its for caching search results)
>
>
>i
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
>
> I'll look into it. What about iteration and indexing? Should it support
> "for element in path" or "for char in path" or nothing?
I frankly can't think of a use for iterating over the characters in
the path, b
Hello!
> How well does PyGTK run on Windows (98, 2K, XP)? How stable is it? Will
> I be able to make an executable (using Py2Exe) of an application that
> uses PyGTK?
I _do_ like PyGTK on Windows. It works without problems.
You can find a ready to use py2exe script on
http://www.pythonwiki.de/PyG
On Sat, Jul 23, 2005 at 11:22:21PM +1000, Steven D'Aprano wrote:
> On Sat, 23 Jul 2005 11:48:27 +0300, Thanos Tsouanas wrote:
> > Hello.
> >
> > I would like to have a quick way to create dicts from object, so that a
> > call to foo['bar'] would return obj.bar.
>
> That looks rather confusing to
On Sat, 23 Jul 2005 07:05:05 +1000, John Machin <[EMAIL PROTECTED]> wrote:
>Daniel Dittmar wrote:
>> Duncan Booth wrote:
>>
>>> I would have expected a path object to be a sequence of path elements
>>> rather than a sequence of characters.
>>
>>
>> Maybe it's nitpicking, but I don't think th
In <[EMAIL PROTECTED]>, Soeren
Sonnenburg wrote:
> Just having started with python, I feel that simple array operations '*'
> and '+' don't do multiplication/addition but instead extend/join an
> array:
>
> a=[1,2,3]
b=[4,5,6]
a+b
> [1, 2, 3, 4, 5, 6]
Both operate on the lists themselv
In <[EMAIL PROTECTED]>, Elmo Mäntynen wrote:
> I know how to make a hash(using mhash), but instead of encoded as hex I
> want it in base32 for use with the bitzi catalog. python-bitzi is useful
> but way too slow for just getting the hash of a file(am going to use it
> elsewhere). Thanks.
Doesn't
* Kay Schluehr wrote:
> you might initialize self.storedAttr with empty dicts and fill them
> later:
>
> self.soredAttr = [{}]*10
> for entry in self.storedAttr:
> entry.update(self.drawAttr)
As a matter of fact, you're doing the same ;-)
In [1]: x = [{}] * 10
In [2]: x[0]['a'] = 1
In [3]
Peter Hansen wrote:
> Reinhold Birkenfeld wrote:
>> Peter Hansen wrote (on Paths not allowing comparison with strings):
>>>Could you please expand on what this means? Are you referring to doing
>>>< and >= type operations on Paths and strings, or == and != or all those
>>>or something else entir
I know how to make a hash(using mhash), but instead of encoded as hex I
want it in base32 for use with the bitzi catalog. python-bitzi is useful
but way too slow for just getting the hash of a file(am going to use it
elsewhere). Thanks.
Elmo
--
http://mail.python.org/mailman/listinfo/python-list
EnderLocke wrote:
> I have a friend who wants to learn python programming. I learned off
> the internet and have never used a book to learn it. What books do you
> recommend?
>
> Any suggestions would be appreciated.
>
I recommend "Learning Python 2nd Edition" by Mark Lutz & David Ascher
(O'Rei
Soeren Sonnenburg wrote:
> Hi all,
>
> Just having started with python, I feel that simple array operations '*'
> and '+' don't do multiplication/addition but instead extend/join an
> array:
>
> a=[1,2,3]
This isn't an array. It is a list. If you want an array, use
Numeric/numarray. If you want
Jan Danielsson wrote:
> Hello all,
>
>I have written a simple whiteboard application. In my application, I
> want to be able to set draw attributes. This part works. I have a
> dictionary object which contains stuff like:
> self.attr['Pen.Color'] = ...
> self.attr['Pen.Thickness'] = ...
>
>
On Thu, 21 Jul 2005 00:45:12 +0200, red <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I'm writing a script for Blender and need to build a face array. My
>engine needs that all faces must be triangles, so I convert quads to
>triangles by dividing them into two triangles. Here is the function:
>
>def build_f
gene tani wrote:
> ok, to make this less open-ended, you should mention what O/S and web
> server you have in mind, whether the web and DB servers will be under
> your admin (big diff betw python and PHP, as far as finding shared
> server accounts at web hosts), what kinds of queries, concurrent
>
Raymond Hettinger wrote:
> [Benji York]
>
>>Note that when using this technique, f.g will not be bound until after
>>you call the function:
>
>
> That is a feature, not a bug. The inner function isn't even created
> until the outer function is run.
I'm fully aware of that. I just didn't want
Peter Hansen <[EMAIL PROTECTED]> writes:
>> * staticmethod Path.getcwd() -> Path.cwd()
>> * bytes() / lines() / text() -> read_file_{bytes,lines,text} methods
>> * write_{bytes,lines,text} -> write_file_{bytes,lines,text} methods
> Under Linux isn't it possible to open and read from directories mu
gene tani wrote:
> To be honest, this is a pretty open-ended question. Are there specific
> issues (SQL injection/security, minimizing db connections, simplest
> code, etc, your'e concerned with?)
Simplest code with be an important factor, since the db will be used far
from max capabilities. Eas
ok, to make this less open-ended, you should mention what O/S and web
server you have in mind, whether the web and DB servers will be under
your admin (big diff betw python and PHP, as far as finding shared
server accounts at web hosts), what kinds of queries, concurrent
read/write volumes, transac
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> On Sat, 23 Jul 2005 11:48:27 +0300, Thanos Tsouanas wrote:
>> Hello.
>>
>> I would like to have a quick way to create dicts from object, so that a
>> call to foo['bar'] would return obj.bar.
>
> That looks rather confusing to me. Why not just call obj.
To be honest, this is a pretty open-ended question. Are there specific
issues (SQL injection/security, minimizing db connections, simplest
code, etc, your'e concerned with?)
To be more honest, googline "Python vs. PHP" raises lots of hits
http://wiki.w4py.org/pythonvsphp.html
http://www.redcor.ch
[EMAIL PROTECTED] writes:
> I am seeing negative latencies of up to 1 second. I am using ntp to
> synchronize both machines at an interval of 2 seconds, so the clocks
> should be very much in sync (and are from what I have observed). I
> agree that it is probably OS, perhaps I should hop over t
I would like to write a Python code like this:It can login a host by SSHafter login the host, use SCP to get a remote file, so it can deliver file to the host.then execute the programthen leave the hostFor example :STEP 1. ssh _yyy at 123.45.67.89STEP 2. Enter the password automatically STEP 3.
Maybe diveintopython.org can help
--
http://mail.python.org/mailman/listinfo/python-list
<[EMAIL PROTECTED]> wrote:
> Jan Danielsson wrote:
> > Hello all,
> >
> >I have written a simple whiteboard application. In my application, I
> > want to be able to set draw attributes. This part works. I have a
> > dictionary object which contains stuff like:
> > self.attr['Pen.Color'] = ...
I would like to write a Python code like this:It can login a host by SSHafter login the host, use SCP to get a remote file, so it can deliver file to the host.then execute the programthen leave the hostFor example :STEP 1. ssh [EMAIL PROTECTED]STEP 2. Enter the password automatically STEP 3. run "
I have a friend who wants to learn python programming. I learned off
the internet and have never used a book to learn it. What books do you
recommend?
Any suggestions would be appreciated.
--
http://mail.python.org/mailman/listinfo/python-list
> > [Andy]
> >>How can you unit test nested functions?
[Raymond Hettinger]
> > For whitebox testing, you could make an inner function visible by
> > binding it to the enclosing function's attribute namespace.
> >
> >def f(x):
> >def g(y):
> > . . .
> >f.g = g#
Hi,
I don't know anything about PHP and I'm initiating right now with
PostgreSQL.
Could someone tell me the pros and cons of assessing the PostgreSQL
databases with Python vs. PHP?
I will need to build a database that has to be assessed by a dozen clients
via a web page in an intranet (possibly
Peter Hansen wrote:
> Just a note, though you probably know, that this is intended to be
> written this way with path:
>
> >>> p / q
> path(u'a/b/c/d')
I know, but it really doesn't look right to me.
I think that my fundamental problem with all of this is that by making path
a subclass of str/
> better to go with SQLite. Its cross platform and well proven. I think
> Firebird will give you that too, though I have never used it.
>
Firebird is a great option, cross platform, it can work like access
without any server running, using embedded mode to a full blown server
which can handle t
Hi all,
Just having started with python, I feel that simple array operations '*'
and '+' don't do multiplication/addition but instead extend/join an
array:
a=[1,2,3]
>>> b=[4,5,6]
>>> a+b
[1, 2, 3, 4, 5, 6]
instead of what I would have expected:
[5,7,9]
or
>>> 2*a
[1, 2, 3, 1, 2, 3]
Well it i
> > [sj]
> >> Thus, random access is an O(1) operation while insertion/deletion is an
> >> O(n) operation.
[Raymond Hettinger]
> > Yes.
[Heikki Orsila aka host.invalid]
> Unfortunately no. Check Terry Reeds answer. Random access is O(1),
> insertion/deletion to front is O(n), and i/d to back is O
Reinhold Birkenfeld wrote:
> Peter Hansen wrote (on Paths not allowing comparison with strings):
>>Could you please expand on what this means? Are you referring to doing
>>< and >= type operations on Paths and strings, or == and != or all those
>>or something else entirely?
>
> All of these. Do
I have a friend who wants to learn python programming. I learned off
the internet and have never used a book to learn it. What books do you
recommend?
Any suggestions would be appreciated.
--
http://mail.python.org/mailman/listinfo/python-list
On 7/19/05, Alberto Vera <[EMAIL PROTECTED]> wrote:
> Hello:
>
> Do you know If the smtplib routine have been changed in last releases?
>
> I used this script:
>
> http://docs.python.org/lib/SMTP-example.html
>
> but it didn't work with the last release.
>
> Do you know any idea about thi
Raymond Hettinger wrote:
> [Andy]
>>How can you unit test nested functions?
> For whitebox testing, you could make an inner function visible by
> binding it to the enclosing function's attribute namespace.
>
>def f(x):
>def g(y):
> . . .
>f.g = g# make g vis
[Andy]
> How can you unit test nested functions? Or do you have to pull them out to
> unit test them, which basically means I will never use nested functions.
Several commons use cases (closures and factory functions) ultimately
expose the inner function through the return value. If that is the
Dark Cowherd wrote:
> My applications would be data entry heavy. Think inventory and accounting
> apps.
>
> Would going past the [Zope] learning curve allow me to write applications
> like that.
You might want to look at Zope 3, there are several niceties for
automatically (or semi-automatica
Jan Danielsson wrote:
> Hello all,
>
>I have written a simple whiteboard application. In my application, I
> want to be able to set draw attributes. This part works. I have a
> dictionary object which contains stuff like:
> self.attr['Pen.Color'] = ...
> self.attr['Pen.Thickness'] = ...
>
>
I've observed something strange about property docstrings and I'm
wondering if anyone here can clarify what's going on: if I create a class
derived from property, the docstrings of the instances end up being that
of the derived class, not the docstring passed into the property
constructor. Examp
Hi,
I have also been looking around to start web development.
Almost everybody says - "Zope h steep learning curve", so looking
at alternatives. But to people have got past that curve. Is Zope worth
it.
My applications would be data entry heavy. Think inventory and accounting apps.
Would goi
There's a few places to stash apps, libraries, or small code snippets
so they can be search engined, if you provide some inline comments,
unit/functional tests, and examples of how to use/known limitations:
Vaults Parnassus, dmoz, ActiveState cookbook
http://aspn.activestate.com/ASPN/Cookbook/Pyth
Hi all,
My query goes like this.
I have two htm files.One is media_try_home.htm and the second one is
media_try.htm.I am attaching these files to my mail so that you guys can
understand the problem.
Now, first simply open the media_try_home.htm and press "PLAY THE FILE"
button.A video clip
Peter Hansen wrote:
> Reinhold Birkenfeld wrote:
>> One thing is still different, though: a Path instance won't compare to a
>> regular
>> string.
>
> Could you please expand on what this means? Are you referring to doing
> < and >= type operations on Paths and strings, or == and != or all thos
Hello all,
I have written a simple whiteboard application. In my application, I
want to be able to set draw attributes. This part works. I have a
dictionary object which contains stuff like:
self.attr['Pen.Color'] = ...
self.attr['Pen.Thickness'] = ...
Now, the problem is that I want to be
this isn't really enough data to go on. What operating system (sounds
like win2k/XP), does Crystal reports and unnamed accounting software
have COM hooks?
Look at Simon Brunning posts:
http://www.brunningonline.net/simon/blog/archives/000652.html
http://aspn.activestate.com/ASPN/Cookbook/Python/
Thanks for all the additional replies thus far!
Apparently the issue, as stated implicitly or explicitly by most of
you, is that new-style class instances essentially defer their magic
methods to the class's static versions of same. This is good to know :)
Ironically, the reason I'm using new
Peter Hansen wrote:
> Under Linux isn't it possible to open and read from directories much as
> with files?
Not really, no.
Python 2.3.4 (#2, Jan 5 2005, 08:24:51)
[GCC 3.3.5 (Debian 1:3.3.5-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> d = open('/us
George Sakkis wrote:
> "Andrew Dalke" <[EMAIL PROTECTED]> wrote:
>>I think that the string representation of a path is so important that
>>it *is* the path.
>
> There are (at least) two frequently used path string representations,
> the absolute and the relative to the working directory. Which o
Reinhold Birkenfeld wrote:
> One thing is still different, though: a Path instance won't compare to a
> regular
> string.
Could you please expand on what this means? Are you referring to doing
< and >= type operations on Paths and strings, or == and != or all those
or something else entirely?
John Machin wrote:
> Reinhold Birkenfeld wrote:
>>Ah, ok. Didn't want to lookup the precedence rules...
>
> Look up the precedence rules? Are you aware of any language where * /
> and % _don't_ have the same precedence??
Given that % is somewhat more esoteric, I certainly have never committed
Reinhold Birkenfeld wrote:
> John Machin wrote:
>
>>Reinhold Birkenfeld wrote:
>>
>>>Berthold Höllmann wrote:
>>>
>>>
Francois De Serres <[EMAIL PROTECTED]> writes:
>hiho,
>
>what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D)
>to the string 'spa
Steven D'Aprano wrote:
>
>
''.join(map(lambda n: chr(n), (0x73, 0x70, 0x61, 0x6D)))
>
> 'spam'
Why the verbal diarrhoea? What's wrong with the (already posted)
''.join(map(chr, (0x73, 0x70, 0x61, 0x6D)))
???
--
http://mail.python.org/mailman/listinfo/python-list
Michael Hoffman wrote:
> Reinhold Birkenfeld wrote:
> > Probably as Terry said: a path is both a list and a string.
[...]
> One way to divide this is solely based on path separators:
>
> ['c:', 'windows', 'system32:altstream', 'test.dir',
> 'myfile.txt.zip:altstream']
I would argue that any prop
On Fri, 22 Jul 2005 12:42:04 +, Odd-R. wrote:
> On 2005-07-22, John Machin <[EMAIL PROTECTED]> wrote:
>> Odd-R. wrote:
>>> I have this list:
>>>
>>> [{'i': 'milk', 'oid': 1}, {'i': 'butter', 'oid': 2},{'i':'cake','oid':3}]
>>>
>>> All the dictionaries of this list are of the same form, and a
On Sat, 23 Jul 2005 11:48:27 +0300, Thanos Tsouanas wrote:
> Hello.
>
> I would like to have a quick way to create dicts from object, so that a
> call to foo['bar'] would return obj.bar.
That looks rather confusing to me. Why not just call obj.bar, since it
doesn't look like you are actually usi
I am preparing to release an extension module that interfaces Python to
the Class Library for Numbers (http://www.ginac.de/CLN/). This module
will provide Python types for arbitrary precision floating point
numbers, rational numbers, and their complex counterparts. The module
also includes most o
On Wed, 13 Jul 2005 11:09:57 +0300, Edvard Majakari <[EMAIL PROTECTED]> wrote:
>
> Suppose one wants to fetch the following data from given network interface,
> say, eth0:
>
Ethinf('eth0').addr()
> '192.168.1.42/24'
...
Ethstat('eth0').rx_bytes()
> 14325235341223
...
> One could implement
Thanos Tsouanas a écrit :
> On Sat, Jul 23, 2005 at 12:06:57PM +0200, Paolino wrote:
>
>>use getattr(self.obj,key) possibly, as __getattribute__ gets total
>>control on attribute access
>
>
> Thanks, but what do you mean by 'total control'?
__getattribute__ is really some kind of an evil blac
Jeffrey E. Forcier wrote:
> ...
> However, you appear to be correct, and the docs appear to be confused:
> class MyClass(object):
> def edit(self):
> return "I'm in edit mode"
> def setEdit(self):
> MyClass.__str__ = self.edit
> ...
> Either way, gues
Thanos Tsouanas wrote:
> On Sat, Jul 23, 2005 at 12:06:57PM +0200, Paolino wrote:
>
>>use getattr(self.obj,key) possibly, as __getattribute__ gets total
>>control on attribute access
>
>
> Thanks, but what do you mean by 'total control'?
>
Probably nothing to do with your question :(
But:
>>>
Steven D'Aprano wrote:
> On Fri, 22 Jul 2005 06:07:28 -0700, Robert Kern wrote:
> ... or even:
>
''.join(map(lambda n: chr(n), (0x73, 0x70, 0x61, 0x6D)))
>
> 'spam'
This is exactly what is wrong with lambda. It yearns for over-use.
This last should be:
>>>''.join(map(chr, (0x73, 0x70, 0x6
Dear All,
I am using Python 2.4 in the linux platform.
At present I am working on webbased file manager.
When I try to upload a file from the linux cgi
script easily fetch the file name by the
filefield.filename. But When I try to upload
a file from the windows machine It won't
retrieve the
The original message was included as attachment
This part of message has been infected and was deleted!
Dr.Web(R) Daemon report:
infected with Win32.HLLM.MyDoom.49
---
Dr.Web(R) Antivirus Service: http://www.drweb.com/
-
On Sat, Jul 23, 2005 at 11:30:19AM +0200, Bruno Desthuilliers wrote:
> Thanos Tsouanas a écrit :
> > class dictobj(dict):
> > """
> > class dictobj(dict):
> > A dictionary d with an object attached to it,
> > which treats d['foo'] as d.obj.foo.
> > """
> > def __init__(self,
On Sat, Jul 23, 2005 at 12:06:57PM +0200, Paolino wrote:
> use getattr(self.obj,key) possibly, as __getattribute__ gets total
> control on attribute access
Thanks, but what do you mean by 'total control'?
--
Thanos Tsouanas .: My Music: http://www.thanostsouanas.com/
http://thanos.sian
Hi,
the arguments in the previous thread were convincing enough, so I made the
Path class inherit from str/unicode again.
It still can be found in CVS:
/python/nondist/sandbox/path/{path.py,test_path.py}
One thing is still different, though: a Path instance won't compare to a regular
string.
O
Little less ugly:
In [12]:class A(object):
: def __str__(self):return self.__str__()
: def str(self):return 'ciao'
: def setStr(self):self.__str__=self.str
:
In [13]:a=A()
In [14]:a.setStr()
In [15]:str(a)
Out[15]:'ciao'
The point is str(ob) builtin l
Rob Cowie a écrit :
> Hi,
>
> I need to create a planner/calendar system using python cgi scripts. It
> is my first CGI app (beyond a few tutorial examples).
>
(snip)
You may want to have a look at the cgi_app mini-framework:
-> http://thraxil.org/code/cgi_app/
It's a port of a Perl framework,
Hi Stani,
Downloaded your latest SPE editor 0.7.4.m . I'm running wxPython 2.6.1
on a Fedora Core 4 machine. The IDE is great but guess what it crashes
without warning. Was typing some code and boom the whole thing
disappeared without a trace. Thought should let you know
All you guys using this I
Thanos Tsouanas wrote:
> Hello.
>
> I would like to have a quick way to create dicts from object, so that a
> call to foo['bar'] would return obj.bar.
>
> The following works, but I would prefer to use a built-in way if one
> exists. Is there one?
>
> class dictobj(dict):
> """
> class
Thanos Tsouanas a écrit :
> Hello.
>
> I would like to have a quick way to create dicts from object, so that a
> call to foo['bar'] would return obj.bar.
>
> The following works, but I would prefer to use a built-in way if one
> exists. Is there one?
>
> Thanks in advance.
>
> class dictobj(di
Hello.
I would like to have a quick way to create dicts from object, so that a
call to foo['bar'] would return obj.bar.
The following works, but I would prefer to use a built-in way if one
exists. Is there one?
Thanks in advance.
class dictobj(dict):
"""
class dictobj(dict):
A dict
1 - 100 of 110 matches
Mail list logo