Re: functions and named keyword arguments

2005-02-21 Thread Diez B. Roggisch
re if I understand you fully, but if what you are after is how to pass named parameters analog to positional args, do it as dict: def foo(name=None): print name foo(**{name: "Fuzzy"}) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda closure question

2005-02-21 Thread Diez B. Roggisch
only recreate them and rebind them to new variables. This prevents whole classes of errors - but of course it also introduces all kinds of other constraints on your programming style, e.g. using monads and so on. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda closure question

2005-02-21 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> It's not only that way in python, but in java too. So it seems that there >> is a fundamental principle behind it: In a language that allows >> sideeffects, these will actually happen.

Re: lambda closure question

2005-02-21 Thread Diez B. Roggisch
d hopfully comprehending...) your post. Sorry. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread Diez B. Roggisch
k the urls - so copy and pasting yields only start or end of the urls, depending on the browser/edit control your pasting into. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Unittest - testing properties (read-only attributes)

2005-02-21 Thread Diez B. Roggisch
lf, instance, attribute, value=1): """Value and multiplier must be readonly""" try: setattr(instance, attribute, value) self.fail("Value is not read only") except AttributeError: pass Then the testing becomes one line: self.test_readonly(self.combat, "value") -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: high resolution time needed

2005-02-21 Thread Diez B. Roggisch
rd unix is a millisecond. And time.time() actually delivers a float with sub-second precision. import time t = time.time() time.sleep(.25) print time.time() - t gives for me (also debian) 0.249767065048 secs. -- Regards, Diez B. Roggisch -- http://mail.python.org/mail

Re: Sequence of empty lists

2005-02-22 Thread Diez B. Roggisch
seq = [[] for i in xrange(10)] -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: searching pdf files for certain info

2005-02-22 Thread Diez B. Roggisch
ght help. It has a free evaluation version, and python bindings. If it's only about text, maybe pdf2text helps. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: python tutorial/projects

2005-02-22 Thread Leif B. Kristensen
Danny skrev: > Does anyone know of a good python tutorial? > I was also looking for some non-trivial projects to do in python. There's a lot of projects on Sourceforge that are written in Python, where you're free to study the code and maybe participate, if you've got what it takes. > Basicall

Weekly Python Patch/Bug Summary

2005-02-22 Thread Kurt B. Kaiser
.org/sf/1126208 opened by Kurt B. Kaiser subprocesss module retains older license header (2005-02-17) http://python.org/sf/1138653 opened by Tres Seaver Python syntax is not so XML friendly! (2005-02-18) CLOSED http://python.org/sf/1143855 opened by Colbert Philippe inspect.getso

Re: running a shell command from a python program

2005-02-23 Thread Leif B. Kristensen
Sandman wrote: > How would I run a shell command in Python? > > Here is what I want to do: > I want to run a shell command that outputs some stuff, save it into a > list and do stuff with the contents of that list. There's a Python Cookbook example that should fit nicely with what you're trying

Re: Vectors in Visual Python

2005-02-25 Thread Diez B. Roggisch
e in effect flat 3 element Numeric arrays, and Numeric ararys can be constructed with Float64 specified as the datatype. """ It was embedded in some disgressing comments (he himself says so, btw.) so you might have missed it. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Trees

2005-02-25 Thread Diez B. Roggisch
def depth_first(self): if self.childs: for child in self.childs: for node in child.depth_first(): yield node yield self.payload tree = Node('root', [Node('child1'), Node('child2')]) for n in tree.depth_firs

Re: accessor/mutator functions

2005-02-25 Thread Diez B. Roggisch
e. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting strings - by iterators?

2005-02-25 Thread Diez B. Roggisch
tlines. > > Any ideas? Maybe [c]StringIO can be of help. I don't know if it's iterator is lazy. But at least it has one, so you can try and see if it improves performance :) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Whither datetime.date ?

2005-02-26 Thread Diez B. Roggisch
7;, 'timedelta', 'tzinfo'] >>> Maybe this is a clash between a custom datetime module and the python one? What does python2.4 -v -c "import datetime" give you? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing a method (function) among several objects.

2005-02-27 Thread Diez B. Roggisch
abuse. A module is a unit of code that (should) encapsulate a certain functionality. So it's perfect for your needs. There is no law or even rule of thumb that makes claims about module size (or the lack of, for this matter). So create a module - it doesn't cost you anything. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help running external program

2005-02-27 Thread Leif B. Kristensen
I'm using wget from Python to get extactly one line from a reports page. I made this function that works for me: def wgetline(exp): # see Python Cookbook p. 228 print "Getting result from server ..." command = 'wget -q -O - \ http://www.foobar.com/report.pl\?UserID=xxx\&UserPW=xxx

Re: Why do descriptors (and thus properties) only work on attributes.

2005-02-28 Thread Diez B. Roggisch
don see why implicitly calling one > of these methods would be any more difficult when they are autonomous > objects than when they are attributes. I still don't see how that is supposed to work for "a lot of interesting things". Can you provide examples for one of these in

Re: Explicit or general importing of namespaces?

2005-02-28 Thread Diez B. Roggisch
ming.html#id12 -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Explicit or general importing of namespaces?

2005-02-28 Thread Diez B. Roggisch
all for some part of the code, then you'd most probably even go for a local variable binding to avoid the lookups in the different scopes - thus the issue of import format gets unimportant again :) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Trees

2005-02-28 Thread Diez B. Roggisch
PEP, an implementation and a > champion with some persuasive ability :) Go wild :) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-02-28 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 303 open ( -5) / 2764 closed ( +9) / 3067 total ( +4) Bugs: 849 open (+11) / 4837 closed ( +3) / 5686 total (+14) RFE : 169 open ( +1) / 148 closed ( +0) / 317 total ( +1) New / Reopened Patches __ New fpcon

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Diez B. Roggisch
>>>> b = a.strip(r'\\\x00') >>>> b > 'A:\\\x00C:\\\x00D:\\\x00E:\\\x00Z:\\\x00' >>>> b = a.split(r'\\\x00') >>>> b > ['A:\\\x00C:\\\x00D:\\\x00E:\\\x00Z:\\\x00'] > > I'm a bit of a novice at

Re: Impersonating other broswers...

2005-03-05 Thread Diez B. Roggisch
le are supported; both are needed to actually retrieve a resource at an https: URL. ''' -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: how to execute Python in VIM

2005-03-05 Thread Diez B. Roggisch
DENG wrote: > ok > > i find it > > map :!d:\python24\python.exe % > > > but it comes with a new pop-up windowsdame~ I'm no windows expert - but maybe pythonw.exe helps here? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding an option on the fly (Tkinter)

2005-03-06 Thread Diez B. Roggisch
> widget["filename"] > > Is this possible to do? Yes. Use dicts to store these buttons so that you can later refer to them. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a method in one class change an object in another class?

2005-03-06 Thread Diez B. Roggisch
e. A variable in python is just a name refering to an object. So this >>> a = 'a' >>> b = a >>> print a, b a a will make a and b both refer to the string 'a'. Now assigning a different value to b will not affect the binding of a: >>> b =

Re: Using for... for multiple lists

2005-03-06 Thread Diez B. Roggisch
> Both filelist and self.checkbox are the same size (4 items btw). Is > there any way to get this done? Use zip: a, b = [1,2,3], ['a', 'b', 'c'] for i,j in zip(a,b): print i,j Or from itertools izip - which should be slightly more performant and less mem

Re: Adding an option on the fly (Tkinter)

2005-03-06 Thread Diez B. Roggisch
fig(enabled=False) Of course this means that cbs has to be a global var. But there exist other options of course - as part of a object or whatever. that depends on your code. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding help...very basic

2005-03-06 Thread Diez B. Roggisch
Hi, people here usually tend not to be too helpful when asked to do an obvious homework task. So if you really want help, provide some code you've already written and that has actual problems. Then we're glad to help. But don't expect others to do your work. -- Regards, D

Re: Error on xpath-ing a DOM with namespaces

2005-03-06 Thread Diez B. Roggisch
S) Evaluate(u'wsdl:description/wsdl:documentation', context=ctx) """ Should give you a start. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: IndexedCatalog and ZEO

2005-03-06 Thread Diez B. Roggisch
n conjunction with zeo as it has no idea of whatever storage is needed - all it does is indexing zodb objects - which you get from zeo as well. Of course that means that you have to keep a catalog for every thread/process that accesses the objects. Alternatively, you maybe can make the IndexedCata

Re: os.system()

2005-03-07 Thread Diez B. Roggisch
what commands actually fail would certainly help. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to make a list unique?

2005-03-08 Thread Diez B. Roggisch
inserted.add(e) listA = res Or, with a little helperfunction: inserted = set() def foo(e): inserted.add(e) return e listA = [foo(e) for e in listA if not e in inserted] But ist's not really much better. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Speeding up CGIHTTPServer (Tim Roberts)

2005-03-08 Thread Diez B. Roggisch
problem - e.g. DNS is often a candidate than can slow down network experience a lot. So maybe thats causing your trouble? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Good variable names (Was: Re: Best way to make a list unique?)

2005-03-08 Thread Diez B. Roggisch
; :-) I usually use much more telling variable names - from the source I just wrote a minute ago: self.selection_color_map = {} self.selection_color = (255,255,0) self.assigned_color_map = {} self.default_color = (0,0,0) self.known_names = sets.Set() As you can see

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Diez B. Roggisch
7;d have > to use: "from some import *", because mainly I'm interrested in assigning > to self: self.x = "blah" > self.y = "uhm" Okay, I try and guess: From your two posts I infer that you want to set variables in instances. But you&#

Re: Sorting dictionary by 'sub' value

2005-03-08 Thread Diez B. Roggisch
'size': 367415L, > 'orientation' : (0x0112) Short=1 @ 42} You can't sort dicts - they don't impose an order on either key or value. There are ordered dict implementations out there, but AFAIK the only keep the keys sorted, or maybe the (key,values) in t

Re: determine directories with wildcard

2005-03-08 Thread Diez B. Roggisch
o is to convert your pattern to a regex: rex = re.compile(r"/dir/dir/.*/dir/.*/dir/.*") Then create a list of dirs with os.walk: dirs = [dirpath for dirpath, foo, bar in os.walk(topdir) if rex.match(dirpath)] This is untested, but should do the trick. -- Regards, Diez B. Roggisch

Re: Format strings that contain '%'

2005-03-08 Thread Diez B. Roggisch
> Will anything else work here? Use %% print "%%s %s" % "foo" -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-03-08 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 279 open (-24) / 2797 closed (+33) / 3076 total ( +9) Bugs: 851 open ( +2) / 4853 closed (+16) / 5704 total (+18) RFE : 173 open ( +4) / 150 closed ( +2) / 323 total ( +6) New / Reopened Patches __ Fix for w

Re: split a string with quoted parts into list

2005-03-10 Thread Diez B. Roggisch
> is there another way to convert a string with quoted sub entries into a > list of strings? try the csv-module. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: thread end and make main program end also?

2005-03-10 Thread Diez B. Roggisch
l end immediately after the main thread terminated. Read the threading modules docs. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie : prune os.walk

2005-03-10 Thread Diez B. Roggisch
Untestet: def foo(base, depth=2): for root, dirs, files in os.walk(base, True): if len(root.split(os.sep)) < depth: yield root, dirs, files for root, dirs, files in foo("/tmp"): print root, dirs, files -- Regards, Diez B. Roggisch -- http://ma

Re: newbie: dictionary - howto get key value

2005-03-10 Thread Diez B. Roggisch
phone = {'mike':10,'sue':8,'john':3} print [key for key, value in phone.items() if value == 3] -> ['john'] -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: char buffer

2005-03-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello all, > > I need to create 6 buffers in python and keep track of it. > I need to pass this buffer, say buffer 1 as an index to a test app. Has > any one tried to do this. Any help with buffer management appreciated. Use the module array. -- R

Re: Confused with classmethods

2005-03-11 Thread Diez B. Roggisch
u observe seems to be a result of your "abuse" of classmethod outside a class scope. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused with classmethods

2005-03-11 Thread Diez B. Roggisch
rrent frame of execution, so def foo(): bar = "baz" makes the bar part of the frames local variables. Scopes just exchange or stack the dicts for name lookup. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe Local XMLRPC

2005-03-12 Thread Diez B. Roggisch
n't be much more than a few lines of code, more or less only subclassing your server from Pyro.core.ObjBase instead of SimpleXMLRPCServer. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: head for grouped data - looking for best practice

2005-03-12 Thread Diez B. Roggisch
t "--data--", data[key_size:] -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Bitmap Newbie question

2005-03-12 Thread Diez B. Roggisch
"C:\\somedir\\test.xbm" -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe Local XMLRPC

2005-03-12 Thread Diez B. Roggisch
the network than soap/xmlrpc. So while the local loopback _might_ be slower (I'm not even sure about that) than the unix socket, marshalling data as xml has its own cost overhead. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe Local XMLRPC

2005-03-13 Thread Diez B. Roggisch
Stephen Waterbury wrote: > Diez B. Roggisch wrote: >> ... corba is 10-100 times faster over >> the network than soap/xmlrpc. ... > > I'm not challenging these statistics (because I don't know), > but I would be interested in the source. Are you referring >

Re: Extending and Embedding

2005-03-13 Thread Diez B. Roggisch
rap the module - which is possible in several ways, including hand-written code, pyrex, swig and sip. Maybe even more, I don't know. Or you access it using the module ctypes that allows to invoke arbitrary methods/funtctions of C-libs. google for it. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Web framework

2005-03-13 Thread Diez B. Roggisch
> accessible with normal development tools since it's stuck in the ZODB. Plain wrong. You can access them via FTP and WEBDAV. In kde under linux, all file-io can be done through these protocols, so you can operate on them as if they were local files. -- Regards, Diez B. Roggisch -- http://

Re: Web framework

2005-03-14 Thread Diez B. Roggisch
tly using ftp as storage backend. (x)emacs for example. > Besides, how to have the > source code under source control if it's stuck in the ZODB? You can still fetch it using webdav and ftp and stick it into CVS/SVN. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I pass structures using a C extension?

2005-03-14 Thread Diez B. Roggisch
u a great deal here) and create an instance of the desired struct. A third way could be to create an extension type that resembles your struct and use that to create the "real" struct by getting the types instance values. HTH -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: simulated samba server

2005-03-15 Thread Diez B. Roggisch
If you can use a linux server, you can create a linux user mode file system - there is a python binding for that - which in turn you could then share using samba. http://www.freenet.org.nz/python/lufs-python/ -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode converting

2005-03-15 Thread Diez B. Roggisch
2" or --enable-unicode=ucs4. You can't set it to utf-8 or utf-16. > 2. how to convert string to UCS-2 s = ... # some ucs-2 string s.decode("utf-16") might give you the right results for most cases: http://mail.python.org/pipermail/python-dev/2002-May/024193.h

Re: why this error?

2005-03-15 Thread Diez B. Roggisch
eed to call them os.getcwd(), as you do in the second call to it. - the join is supposed to work on a list of arguments, like this: os.path.join("a", "b", "c") will yield a/b/c But you concatenate two strings using +, and thus have only one argument at all, whi

Re: About Databases...

2005-03-16 Thread Leif B. Kristensen
Peter A. Schott wrote: > PostGreSQL - good feature set, open source. Not sure on speed, but it > should run natively on Unix, Linux, and Win32 (not sure about BSD or > others). A lot of the core developers of PostgreSQL are apparently running *BSD. On the PostgreSQL-General mailing list, I've no

Re: Why tuple with one item is no tuple

2005-03-16 Thread Diez B. Roggisch
guity. Soo, in the end it boils down to some explicitness - where IMHO an additional comma is pretty much no problem at all. Another option would of course be the introduction of different parentheses for tuples - but I can't find some on my keyboard. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-16 Thread Diez B. Roggisch
reasoning before - I remember you wanting to shave off microseconds by optimising constant expressions like 5*4 whilst at the same time arguing in another thread that you'd like to have mutable keys for dicts that needed copying the very same keys - at much greater costs, per case and even more so in general as using dicts is common where pure constant arithmetic expressions aren't. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-16 Thread Diez B. Roggisch
5' etc. > > I find this 'creative use of overloading' rather awful. But what the > heck, I find list comprehension rather awful. Well, the number of operators built into the language is limited - and I actually prefer to have the possibility to overload these if I want to. No

Re: Why tuple with one item is no tuple

2005-03-17 Thread Diez B. Roggisch
had you > would have known that if the objects one had to work with were at > the same time mutable and usefull as keys, you have to turn them > into an immutable now for use as a key. This is a copy operation. > So compared to the situation now, no extra copying would b

Re: fastest postgresql module

2005-03-17 Thread Leif B. Kristensen
Timothy Smith skrev: > has anyone got some hard numbers on which pg access module is the > fastest, i currently use pypgsql, but i can't help but feel it's a > little slow. > 3 seconds to connect, send one query, get th return data. > i'm on a adsl 1.5mbit/256kbit link, the server is on a 10/10mbi

Re: fastest postgresql module

2005-03-17 Thread Leif B. Kristensen
Timothy Smith skrev: > my only issue with psycopg, is last time i looked they had no win32 > port? Uh, in that case, maybe you should consider changing platform? 8^) -- Leif Biberg Kristensen just another global village idiot -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-18 Thread Diez B. Roggisch
tfor urllib.urlopen(path, async=True) > outfile = waitfor open(path.split('/')[-1], async=True) > waitfor outfile.write(waitfor infile.read(async=True), async=True) > infile.close() > outfile.close() > > def main(): > a = get_and_save("htt

Re: HELP:UnboundLocalError: local variable '_nntp' referenced before assignment

2005-03-18 Thread Diez B. Roggisch
Peter Moscatt wrote: > UnboundLocalError: local variable '_nntp' referenced before assignment This pretty much says what your problem is: you haven't a variable called _nntp > def callconnect(): > if b["text"]=="Connect": >

Re: syntax incorrect with regex

2005-03-18 Thread Diez B. Roggisch
"",re.VERBOS) > ^ > SyntaxError: invalid syntax No problem here. Is your indentation correct? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to I restart an interactive session?

2005-03-18 Thread Diez B. Roggisch
ven't I restored the interpreter to a virgin > state? You can't unload modules, or at least reload is not always working properly. So - you'd gotta go the road IDLE has gone before I assume. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-03-18 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 286 open ( +7) / 2801 closed ( +4) / 3087 total (+11) Bugs: 870 open (+19) / 4867 closed (+14) / 5737 total (+33) RFE : 175 open ( +2) / 150 closed ( +0) / 325 total ( +2) New / Reopened Patches __ inspect.p

Re: Simple XML-to-Python conversion

2005-03-19 Thread Diez B. Roggisch
don't bother if ini-Files are popular on linux or not - on linux a great deal of different formats is popular, and nobody seems to care too much. E.g. samba uses ini-style config, too. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to I restart an interactive session?

2005-03-19 Thread Diez B. Roggisch
s not working fully as expected in some cases. > state at point A and point B the same? > > --- point A: > import os > del __main__.__dict__['os'] > --- point B > > I guess my question boils down to, is the state of the python > interpret

Re: determine os language

2005-03-19 Thread Diez B. Roggisch
Bryan wrote: > is there a way to determine the operating system's language? i can't seem > to find a method that returns the value. Try the module locale. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Variable Variable

2005-03-20 Thread Diez B. Roggisch
> > Personally I could live with that, but the diagram is a bit special > because of the restriction of the = operation. I do not know if PHP > supports this operational view by enabling iterations: $a, $$a, $$$a > ... ? It does. -- Regards, Diez B. Roggisch -- http://mail.pyt

Re: inline comparison

2005-03-20 Thread Diez B. Roggisch
rser, ...]: mo = m.match(data) if mo: break -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: how to drop all thread ??

2004-11-29 Thread Diez B. Roggisch
condition: # do something pass If that running-condition is queried often enough, you can stop the thread by setting it to false. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: date diff calc

2004-11-29 Thread Diez B. Roggisch
alternative, as it lets specify you the format by a string. > print ed , '-', bd , '=', (ed-bd).days I can't imagine what could possibly be easier than subtracting two dates - in fact, most times one has to jump through much more hoops to achieve these results, e.g. in j

Re: weird behaviour of "0 in [] is False"

2004-11-30 Thread Diez B. Roggisch
. Then your expression gets translated to: 0 in l and l is False which yields False of course. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: Ice 2.0 released

2004-11-30 Thread Diez B. Roggisch
mmercial license makes sense - it does for trolltech :) And there is nothing in GPL that forces you to integrate code you've been offered - otherwise, killing a GPL lib would mean to delete all from a CVS checkout and submit a patch from that - obviouly nobody would enforce that. -

Re: A way to wait Python event

2004-11-30 Thread Diez B. Roggisch
preter in case of an exception. Unindenting the last while will wait in every case, so you can inspect the output nonetheless. Apart from that, there might be some hidden "keep this damn window open after the executed progam terminated"-checkbox. Happy hunting. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

ANN: pyMinGW support for Python 2.4 (final) is available

2004-12-01 Thread A. B., Khalid
This is to inform those interested in compiling Python in MinGW that an updated version of pyMinGW is now available. Get it from here: http://jove.prohosting.com/iwave/ipython/pyMinGW.html Regards Khalid -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2004-12-01 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 258 open ( +4) / 2701 closed ( +1) / 2959 total ( +5) Bugs: 812 open (+28) / 4642 closed (+13) / 5454 total (+41) RFE : 160 open ( +4) / 136 closed ( +1) / 296 total ( +5) New / Reopened Patches __ #1074261

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Diez B. Roggisch
parts that's already available, e.g. for debian which handles dependencies usually much better and is easier to use for online updates. I think we have to wait until consistent dependency checking and so on are established - maybe LSB helps us there. -- Regards, Diez B. Roggisch -- http:

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Diez B. Roggisch
less a general scheme is adopted, no software project will burden itself with the task of doing this. So you have to wait for your distribution to do that for them - which may result in not-so-latest verisons. Or even none at all -- Regards, Diez B. Roggisch -- http://mail.python.org/m

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Diez B. Roggisch
ebian nearly all libs come with an extra dev-package you need when compiling against them. No big deal, but compiling software yourself usually means to downtrack these packages by making multiple configure runs, until all missing headerfiles are there. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient intersection of lists with rounding

2004-12-02 Thread Diez B. Roggisch
> A couple of other bits of info. > - a and b are ordered smallest to largest (could bisect module be used?) > - in the future I will want to round the second number of closest 0.25 > rather than whole number. > > Would the sets module be more efficient? > > I'm

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> How about sys.byteorder? This doesn't help, as he wants to read files from varying endianess - what the _current_ endianess is doesn't matter here. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
olutely no way of telling the endianess. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> But, in fact, he says the files are always big endian. So, code like > the following should address his problem. Note I use type 'h' as an > example so I can easily read samples. I'm sorry, I confused that he asked for machine endianess. Then of course you are righ

Re: How is Python designed?

2004-12-04 Thread Diez B. Roggisch
rpretation efficiency is comparable to most > popular interpreters. I'd say that's pretty much standard interpreter technique - an expression like this: foo = a + b * c is translated and reduced to an abstract-syntax-tree something like this: Assignment("foo", BinaryOp("+&

Re: Import Semantics, or 'What's the scope of an import?', and class attribute instantiation

2004-12-04 Thread Diez B. Roggisch
f I import in in a 'higher-level' > module. For example: In the psyco doc it says that you can do full() - but it will bloat the memory consumption, so its better to use either explicit or profile-based optimization. I suggest reading the docs for psyco on thate. > > A.py >

Re: How is Python designed?

2004-12-05 Thread Diez B. Roggisch
Any way I will continue to improve that interpreter, > it's an interesting thing for me. I don't have negative opinions about yuan and by no meants want to discourage you developing it. Its a nice project. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: How is Python designed?

2004-12-06 Thread Diez B. Roggisch
> Sorry maybe I didn't understand that part correctly > and took grant that it would be implemented in > recursive way. I just wondered if the following can be > extended for arbitrary length arithmetic expressions: > Assignment("foo", BinaryOp("+", Get("a&q

Re: help using sockets, and OOP?

2004-12-06 Thread Diez B. Roggisch
for scenarios such as yours. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2004-12-06 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 259 open ( +1) / 2705 closed ( +4) / 2964 total ( +5) Bugs: 800 open (-12) / 4662 closed (+20) / 5462 total ( +8) RFE : 160 open ( +0) / 137 closed ( +1) / 297 total ( +1) New / Reopened Patches __ add key

Re: How is Python designed?

2004-12-07 Thread Diez B. Roggisch
h a stack/lifo as node container, deepth-first is using a queue/fifo instead - but there is _no_ gain in terms of speed here - both have to visit all nodes. There is no reason to change you running system - but your hopes for more performance that way aren't fulfilled either. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   9   10   11   >