downloading web images

2005-10-22 Thread Joe
I'm just wandering if I'm doing this correct way I'm trying to download an image and store it into a file this does the job, but created file does not apear to be an image, it works fine and I can open image, I'm just wandering if there is a better way of doing this. htmlSource=urllib.urlopen("ht

calling a dylib in python on OS X

2005-10-22 Thread robspychala
Hi Is there something similar to python's windll for calling DLLs on win32 but meant for calling dylib's on OS X? thanks, r.s. -- http://mail.python.org/mailman/listinfo/python-list

Test

2005-10-22 Thread cracki
The message contains Unicode characters and has been sent as a binary attachment. KWF Email scanner was unable to check following file (i.e. corrupted/encrypted zip archive): Name: message.zip Content type: application/octet-stream This file was removed by Firewall. -- http

Re: IDE recommendation please

2005-10-22 Thread Joe
SPE is great I suggest you take a look at it http://www.stani.be/python/spe/ [EMAIL PROTECTED] wrote: >> On the Mac, I think the XCode integration you get with PyObjC is >> probably best. I know there are plugins for Eclipse but haven't tried >> any personally, so it's hard to make suggestions

Re: best way to replace first word in string?

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 22 Oct 2005 14:54:24 -0400, Mike Meyer wrote: >>> The string formatting is two orders of magnitude faster than the >>> concatenation. The speed difference becomes even more obvious when you >>> increase the number of strings being concatenated:

Re: best way to replace first word in string?

2005-10-22 Thread Ron Adam
[EMAIL PROTECTED] wrote: > interesting. seems that "if ' ' in source:" is a highly optimized code > as it is even faster than "if str.find(' ') != -1:' when I assume they > end up in the same C loops ? The 'in' version doesn't call a function and has a simpler compare. I would think both of th

Re: Python vs Ruby

2005-10-22 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> > Every line = more labour for the developer = more cost and time. >> > Every line = more places for bugs to exist = more cost and time. >> There were studies done in the 70s that showed that programmers >> produce

Re: IDE recommendation please

2005-10-22 Thread [EMAIL PROTECTED]
I am an even worse dinosaur, I use ion3 and console vim. Alex Martelli wrote: > On the Mac, I think the XCode integration you get with PyObjC is > probably best. I know there are plugins for Eclipse but haven't tried > any personally, so it's hard to make suggestions (I'm a dinosaur, and I > pref

Re: Question about inheritance...

2005-10-22 Thread Ron Adam
KraftDiner wrote: > Well here is a rough sketch of my code... > This is giving my two problems. > > 1) TypeError: super() argument 1 must be type, not classobj > 2) I want to be sure the the draw code calls the inherited classes > outline and not its own... > > class Shape: > def __init__(

Re: Microsoft Hatred FAQ

2005-10-22 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] Neither I, nor you, nor the government of any nation, should care a monkey's toss specifically for Microsoft's success. Microsoft is one special interest, out of

Re: best way to replace first word in string?

2005-10-22 Thread [EMAIL PROTECTED]
interesting. seems that "if ' ' in source:" is a highly optimized code as it is even faster than "if str.find(' ') != -1:' when I assume they end up in the same C loops ? Ron Adam wrote: > Guess again... Is this the results below what you were expecting? > > Notice the join adds a space to the en

Re: IDE recommendation please

2005-10-22 Thread Alex Martelli
microsnot <[EMAIL PROTECTED]> wrote: > I'm new to Python but am wondering what IDE Python developers use? I use Mac > OS X 10.4.2. I have PythonIDE which comes with MacPython but I don't think > that has even rudimentary "intellisense". Xcode and Eclipse don't seem to > support Python out of the b

wxpython - passing arg to wx.app OnInit

2005-10-22 Thread Stuart McGraw
I have a wxPython app, conventionally structured with a Application class derived from wx.App. My problem is that the app accepts a command line argument that must be acted upon within the OnInit() method of the Application class. How do I pass it cleanly from main() into app.OnInit()? In the si

IDE recommendation please

2005-10-22 Thread microsnot
I'm new to Python but am wondering what IDE Python developers use? I use Mac OS X 10.4.2. I have PythonIDE which comes with MacPython but I don't think that has even rudimentary "intellisense". Xcode and Eclipse don't seem to support Python out of the box. Suggestions for plugins for Eclipse would

ANN: formulaic 0.1

2005-10-22 Thread gsteff
I've been working on a form generation toolkit that integrates well with FormEncode... its still under heavy development, of course, but I've seen a lot of discussion of this topic on various mailing lists over the past few days, and so wanted to get something out. Release early and all that. So

Re: best way to replace first word in string?

2005-10-22 Thread Ron Adam
Steven D'Aprano wrote: > On Sat, 22 Oct 2005 21:41:58 +, Ron Adam wrote: > > >>Don't forget a string can be sliced. In this case testing before you >>leap is a win. ;-) > > > Not much of a win: only a factor of two, and unlikely to hold in all > cases. Imagine trying it on *really long

Re: best way to replace first word in string?

2005-10-22 Thread Steven D'Aprano
On Sat, 22 Oct 2005 14:54:24 -0400, Mike Meyer wrote: >> The string formatting is two orders of magnitude faster than the >> concatenation. The speed difference becomes even more obvious when you >> increase the number of strings being concatenated: > > The test isn't right - the addition test ca

Re: C extension modules in Python

2005-10-22 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hello, > > I'vre written an extension module to accelarate some code i've made in > python with numarray. Then i compiled an linke d it with swig, my > problem is that when i make the import in my python code it gives me an > error: ImportError: libnumarray.so: cannot op

Re: Microsoft Hatred FAQ

2005-10-22 Thread Roedy Green
On Sun, 23 Oct 2005 11:46:53 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote or quoted : > >Or would you like to suggest that Microsoft's board of directors should be >allowed carte blache to break any law, commit any deed, so long as it >makes Microsoft money? Why should the standards of accep

Re: path

2005-10-22 Thread Erik Max Francis
Shi Mu wrote: > what is the differenc ebetween index and find in the module of string? > for both "find" and "index", I got the position of the letter. >>> import string >>> help(string.find) Help on function find in module string: find(s, *args) find(s, sub [,start [,end]]) -> in R

Re: index and find

2005-10-22 Thread Sam Pointon
>>> s = 'foobar' >>> s.find('z') -1 >>> s.index('z') Traceback (most recent call last): File "", line 1, in -toplevel- s.index('z') ValueError: substring not found Pretty self explanatory. -- http://mail.python.org/mailman/listinfo/python-list

index and find

2005-10-22 Thread Shi Mu
what is the difference between index and find in the module of string? for both "find" and "index", I got the position of the letter. On 10/19/05, Shi Mu <[EMAIL PROTECTED]> wrote: > I have installed Python 2.3 and I type "help()" and then "Keywords". > I get a list of words. And it says that I ca

Re: path

2005-10-22 Thread Shi Mu
what is the differenc ebetween index and find in the module of string? for both "find" and "index", I got the position of the letter. -- http://mail.python.org/mailman/listinfo/python-list

Re: C extension modules in Python

2005-10-22 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Hello, > > I'vre written an extension module to accelarate some code i've made in > python with numarray. Then i compiled an linke d it with swig, my > problem is that when i make the import in my python code it gives me an > error: ImportError: libnumarray.so: cannot

Re: Question about inheritance...

2005-10-22 Thread Kent Johnson
KraftDiner wrote: > This is what I've got so far: > class Rect(Shape): > def __init__(self): > super(self.__class__, self).__init__() Should be super(Rect, self).__init__() > def render(self): > super(self.__class__, self).render() ditto In this exampl

Re: Python vs Ruby

2005-10-22 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > > Every line = more labour for the developer = more cost and time. > > Every line = more places for bugs to exist = more cost and time. > > There were studies done in the 70s that showed that programmers > produced the same number of debugged lines of code

Re: Microsoft Hatred FAQ

2005-10-22 Thread Steven D'Aprano
On Sat, 22 Oct 2005 18:02:44 -0700, David Schwartz wrote: > I see you are a totalitarianist or perhaps a communist. If you want to > live in America and discuss things that are relevent to America, let me > know. In other words, "why don't you go back to Russia, you commie pinko fascist Jew

Re: Microsoft Hatred FAQ

2005-10-22 Thread Steven D'Aprano
On Sat, 22 Oct 2005 16:17:20 -0700, David Schwartz wrote: >>> Microsoft goal is and should be their own success, not the success of >>> the economy or the market in general. > >> Neither I, nor you, nor the government of any nation, should care a >> monkey's toss specifically for Microsoft's

Re: Question about inheritance...

2005-10-22 Thread Alex Martelli
KraftDiner <[EMAIL PROTECTED]> wrote: > Well here is a rough sketch of my code... > This is giving my two problems. > > 1) TypeError: super() argument 1 must be type, not classobj Make your classes new-style (have Shape inherit from object) to fix this. You're using the legacy (old-style) objec

Re: Question about inheritance...

2005-10-22 Thread KraftDiner
This is what I've got so far: class Shape(object): def __init__(self): pass def render(self): print 'Shape render' self.outline() def outline(self): pass class Rect(Shape): def __init__(self):

Re: Microsoft Hatred FAQ

2005-10-22 Thread Roedy Green
On Sun, 23 Oct 2005 01:00:31 GMT, Roedy Green <[EMAIL PROTECTED]> wrote or quoted : >The choice was go along with MS arm twisting or go out of business. > >I call that extortion. I deeply resent this, because they not only ripped me off, they put me a in position I felt compelled to become part o

Re: Microsoft Hatred FAQ

2005-10-22 Thread David Schwartz
"Roedy Green" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 22 Oct 2005 16:10:24 -0700, "David Schwartz" > <[EMAIL PROTECTED]> wrote or quoted : >>If the deal didn't give you more than it cost you, all you had to do >> was >>say 'no'. I understand the frustration at

Re: Listening for keypress in the background

2005-10-22 Thread Mathias Dahl
Mathias Dahl <[EMAIL PROTECTED]> writes: > Peter Hansen <[EMAIL PROTECTED]> writes: > >>> How can I make it listen for a certain keypress (say, Windows-key + >>> space) in a controlled fashion even when it is not the program having >>> focus? >>> >>> I need to do this running under GNOME in Mandr

Re: Microsoft Hatred FAQ

2005-10-22 Thread David Schwartz
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >>> Neither I, nor you, nor the government of any nation, should care a >>> monkey's toss specifically for Microsoft's success. Microsoft is one >>> special interest, out of a potentially unbounded number of possible >>> pl

Re: Microsoft Hatred FAQ

2005-10-22 Thread Roedy Green
On Sat, 22 Oct 2005 16:10:24 -0700, "David Schwartz" <[EMAIL PROTECTED]> wrote or quoted : >If the deal didn't give you more than it cost you, all you had to do was >say 'no'. I understand the frustration at being forced to pay for something >what it is worth. The choice was go along with M

Re: Question about inheritance...

2005-10-22 Thread KraftDiner
Well here is a rough sketch of my code... This is giving my two problems. 1) TypeError: super() argument 1 must be type, not classobj 2) I want to be sure the the draw code calls the inherited classes outline and not its own... class Shape: def __init__(self): pass

Re: best way to replace first word in string?

2005-10-22 Thread Steven D'Aprano
On Sat, 22 Oct 2005 21:41:58 +, Ron Adam wrote: > Don't forget a string can be sliced. In this case testing before you > leap is a win. ;-) Not much of a win: only a factor of two, and unlikely to hold in all cases. Imagine trying it on *really long* strings with the first space close to

Re: best way to replace first word in string?

2005-10-22 Thread Chris F.A. Johnson
On 2005-10-22, William Park wrote: > Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: >> On 2005-10-22, William Park wrote: >> > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> I am looking for the best and efficient way to replace the first word >> >> in a str, like this: >> >> "aa to become" -> "

Re: Binding a variable?

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 21 Oct 2005 13:33:18 -0400, Mike Meyer wrote: > >> Paul Dale <[EMAIL PROTECTED]> writes: >> >>> Hi everyone, >>> >>> Is it possible to bind a list member or variable to a variable such that >>> >>> temp = 5 >>> >>> list = [ temp ] > > Don't us

Re: Python vs Ruby

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 21 Oct 2005 13:03:29 +0100, Alex Stapleton wrote: >> Perl is more like a CISC CPU. There are a million different commands. >> Python is more RISC like. >> Line count comparisons = pointless. > > Not so. > > Every line = more labour for the devel

Re: Microsoft Hatred FAQ

2005-10-22 Thread Mike Meyer
"David Schwartz" <[EMAIL PROTECTED]> writes: > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Fri, 21 Oct 2005 21:47:27 -0700, David Schwartz wrote: That's basic economics. Something which can be allowed or ignored or even encouraged when done

Re: Python cgi

2005-10-22 Thread jbrewer
I added enctype="multipart/form-data" to the tag, and that seemed to solve it. Thanks. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Binding a variable?

2005-10-22 Thread Steven D'Aprano
On Fri, 21 Oct 2005 13:33:18 -0400, Mike Meyer wrote: > Paul Dale <[EMAIL PROTECTED]> writes: > >> Hi everyone, >> >> Is it possible to bind a list member or variable to a variable such that >> >> temp = 5 >> >> list = [ temp ] Don't use the names of built-in functions as variables. >> temp ==

Re: best way to replace first word in string?

2005-10-22 Thread William Park
Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: > On 2005-10-22, William Park wrote: > > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> I am looking for the best and efficient way to replace the first word > >> in a str, like this: > >> "aa to become" -> "/aa/ to become" > >> I know I can use spil

Re: Python vs Ruby

2005-10-22 Thread Steven D'Aprano
On Fri, 21 Oct 2005 13:03:29 +0100, Alex Stapleton wrote: > > On 21 Oct 2005, at 09:31, Harald Armin Massa wrote: > >> Casey, >> >> >> >>> I have heard, but have not been able to verify that if a program is >>> about >>> 10,000 lines in C++ >>> it is about >>> 5,000 lines in Java >>> and it is a

Re: High Order Messages in Python

2005-10-22 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I'm reading about "high order messages" in Ruby by Nat Pryce, and > thinking if it could be util and if so, if it could be done in Python. > Someone already tried? Yes, I'm pretty sure it could be done in Python. All it really needs is the abilit

Re: python gc performance in large apps

2005-10-22 Thread Neal Norwitz
Jp Calderone wrote: > On Fri, 21 Oct 2005 16:13:09 -0400, Robby Dermody <[EMAIL PROTECTED]> wrote: > > > > [snip - it leaks memory] > > One thing to consider is that the process may be growing in size, not because > garbage objects are not being freed, but because objects which should be > garbag

Re: Microsoft Hatred FAQ

2005-10-22 Thread David Schwartz
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 21 Oct 2005 21:47:27 -0700, David Schwartz wrote: >>> That's basic economics. Something which can be allowed or ignored or >>> even >>> encouraged when done by small businesses in a competitive market can >

Re: Microsoft Hatred FAQ

2005-10-22 Thread David Schwartz
"Roedy Green" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 21 Oct 2005 21:47:27 -0700, "David Schwartz" > <[EMAIL PROTECTED]> wrote or quoted : >> There is no way Microsoft could have expected the >>market to be defined in this way and no way to argue that Microsoft had

Re: Microsoft Hatred FAQ

2005-10-22 Thread Tim Tyler
Mike Meyer <[EMAIL PROTECTED]> wrote or quoted: > Wrong. The only obligation Microsoft has is to their shareholders. > That obligation has nothing to do with computing - it's to make a > profit. It's MS's habit of doing things in pursuit of profit that, > while short of force, are borderline fraud

Re: High Order Messages in Python

2005-10-22 Thread Sam Pointon
This can be suitably applied to Python with the use of Higher Order Functions, though. It's not quite the Ruby version because Python allows you to use functions as first-class objects, complicating the All-You-Can-Do-Is-Pass-A-Message philosophy. This is my 5-minute implementation: class HigherO

Re: High Order Messages in Python

2005-10-22 Thread Jp Calderone
On 22 Oct 2005 15:11:39 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Hum... I thnk you dont get the ideia: I'm not talking abou High Order >Functions. >What ho call "High Order Methods is some like "connecting" some >'generic' methods created to do things like this: >claimants.where.r

System tray Icon

2005-10-22 Thread Mike Pippin
How would I have an app run with just a system tray Icon??? any help would be greatly appreciated. I have no clue where to start. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about inheritance...

2005-10-22 Thread Ron Adam
KraftDiner wrote: > I have a base class called Shape > And then classes like Circle, Square, Triangle etc, that inherit from > Shape: > > My quesiton is can a method of the Shape class call a method in Circle, > or Square etc...? This looks familiar. :-) Yes, it can if it has references to the

Re: High Order Messages in Python

2005-10-22 Thread [EMAIL PROTECTED]
Hum... I thnk you dont get the ideia: I'm not talking abou High Order Functions. What ho call "High Order Methods is some like "connecting" some 'generic' methods created to do things like this: claimants.where.retired?.do.receive_benefit 50 The 2nd and 3rd links that in the first post is the m

Re: High Order Messages in Python

2005-10-22 Thread Jp Calderone
On 22 Oct 2005 14:12:16 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I'm reading about "high order messages" in Ruby by Nat Pryce, and >thinking if it could be util and if so, if it could be done in Python. >Someone already tried? Here's an example of the idea, in Python: def messa

Re: Question about inheritance...

2005-10-22 Thread Mike Meyer
"KraftDiner" <[EMAIL PROTECTED]> writes: > I have a base class called Shape > And then classes like Circle, Square, Triangle etc, that inherit from > Shape: > > My quesiton is can a method of the Shape class call a method in Circle, > or Square etc...? Yup: >>> class Shape(object): ... def comm

Re: Question about inheritance...

2005-10-22 Thread Oliver Andrich
Hi, 22 Oct 2005 14:40:09 -0700, KraftDiner <[EMAIL PROTECTED]>: > I have a base class called Shape > And then classes like Circle, Square, Triangle etc, that inherit from > Shape: > > My quesiton is can a method of the Shape class call a method in Circle, > or Square etc...? even there would exis

Re: best way to replace first word in string?

2005-10-22 Thread [EMAIL PROTECTED]
The RE way, was much slower I used the spilt, it was better I tought because there was no need to take it to the memory again, but it just my thougth -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to replace first word in string?

2005-10-22 Thread Ron Adam
Steven D'Aprano wrote: > def replace_word(source, newword): > """Replace the first word of source with newword.""" > return newword + " " + "".join(source.split(None, 1)[1:]) > > import time > def test(): > t = time.time() > for i in range(1): > s = replace_word("aa to

Question about inheritance...

2005-10-22 Thread KraftDiner
I have a base class called Shape And then classes like Circle, Square, Triangle etc, that inherit from Shape: My quesiton is can a method of the Shape class call a method in Circle, or Square etc...? -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: PID and/or handle assistance. . .?

2005-10-22 Thread Michael Williams
On Oct 22, 2005, at 1:16 PM, [EMAIL PROTECTED] wrote:Michael Williams wrote: Hi All, Can anyone explain how to both spawn processes from PYTHON and  acquire their process IDs or a handle to them for use later?  I'd  also like to acquire the stdout of each spawned process. Google dead today? Well,

High Order Messages in Python

2005-10-22 Thread [EMAIL PROTECTED]
I'm reading about "high order messages" in Ruby by Nat Pryce, and thinking if it could be util and if so, if it could be done in Python. Someone already tried? References: http://lambda-the-ultimate.org/node/view/1047 http://nat.truemesh.com/archives/000535.html http://nat.truemesh.com/archives/0

Re: KeyboardInterrupt vs extension written in C

2005-10-22 Thread Jp Calderone
On 22 Oct 2005 22:02:46 +0200, Dieter Maurer <[EMAIL PROTECTED]> wrote: >"Tamas Nepusz" <[EMAIL PROTECTED]> writes on 20 Oct 2005 15:39:54 -0700: >> The library I'm working on >> is designed for performing calculations on large-scale graphs (~1 >> nodes and edges). I want to create a Python int

Re: python gc performance in large apps

2005-10-22 Thread Jp Calderone
On Fri, 21 Oct 2005 16:13:09 -0400, Robby Dermody <[EMAIL PROTECTED]> wrote: > >Hey guys (thus begins a book of a post :), > >I'm in the process of writing a commercial VoIP call monitoring and >recording application suite in python and pyrex. Basically, this >software sits in a VoIP callcenter-typ

Re: KeyboardInterrupt vs extension written in C

2005-10-22 Thread Dieter Maurer
"Tamas Nepusz" <[EMAIL PROTECTED]> writes on 20 Oct 2005 15:39:54 -0700: > The library I'm working on > is designed for performing calculations on large-scale graphs (~1 > nodes and edges). I want to create a Python interface for that library, > so what I want to accomplish is that I could just

Re: Jargons of Info Tech industry

2005-10-22 Thread noah bedford
On Wed, 12 Oct 2005 21:50:22 GMT Roedy Green <[EMAIL PROTECTED]> wrote: >It is almost like providing ladders and setting out cookies and milk >for the burglars. Fire escapes at christmas. -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to replace first word in string?

2005-10-22 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > py> def tester(n): > ... s1 = "" > ... s2 = "%s" * n > ... bytes = tuple([chr(i % 256) for i in range(n)]) > ... t1 = time.time() > ... for i in range(n): > ... s1 = s1 + chr(i % 256) > ... t1 = time.time() - t1 > ...

Re: Zope and Persistence

2005-10-22 Thread Terry Hancock
On Saturday 22 October 2005 12:34 pm, [EMAIL PROTECTED] wrote: > I don't know if this is the appropriate place to post a Zope question > but I figure many here are familiar with it. You will do much better to use the Zope users' mailing list. Go to zope.org and follow the mailing lists link to sig

any good midi tutorials?

2005-10-22 Thread malik
anybody know any good midi tutorials for python? i am trying to make a realtime midi manipulation application. -- http://mail.python.org/mailman/listinfo/python-list

Re: find() method in ElementTree

2005-10-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > My questions: > 1) in the example above is there a subelement of doc with a tag > 'SampleDetails'? find only searches for direct subelements; SampleDetail is not a direct subelement to SampleRoot, since there's a SpecificInformation element in between. > 2) if so, what

Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-22 Thread uid09012_ti
Hi, i get the following error message when i use py2exe on my application: The following modules appear to be missing ['_ssl', 'ext.IsDOMString', 'ext.SplitQName'] I've installed PyXML-0.8.4.win32-py2.4.exe. My version of python is 2.4 I've checked in the pyxml directories and these modules are

UI Design, XUL, Blender

2005-10-22 Thread Terry Hancock
Newcomers to Blender (3D modelling/animation program) often find its fairly unique UI a bit off-putting, but on closer inspection, I find it's a very compelling design for "power users" (i.e. professionals who need to use a given program on a daily basis, and who are therefore willing to make the e

find() method in ElementTree

2005-10-22 Thread mirandacascade
I do not understand how to use the find() method in ElementTree. The file 'sample.xml' is: FindMystery abc >>> from elementtree.ElementTree import ElementTree >>> doc = ElementTree(file='sample.xml') >>> iterList = doc.getiterator() >>> iterList [, , , , ]

Zope and Persistence

2005-10-22 Thread ryankaskel
I don't know if this is the appropriate place to post a Zope question but I figure many here are familiar with it. I'm confused about the role of the ZMI when it comes to development. I want to write a simple script that logs page hits. I wrote it in what was called a Script (Python) resource in th

Re: subprocess exiting in an incomprehensible fashion

2005-10-22 Thread Will
Well, I'll be damned... Thank you very much. I'm still getting a little tripped up with blocking IO and whatnot, but I think I can work that out. This was a real help, thanks again. #!/usr/bin/python # -*- coding: UTF-8 -*- import subprocess import random import re import os import time import se

Re: Python variables are bound to types when used?

2005-10-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > reset your brain: > > > > http://effbot.org/zone/python-objects.htm > > Neat link. > > Can you expand on this: > > > a type (returned by type(x)) > ... > > You cannot change the type. the page was written before the "type/class unification" in Python 2.2, at a tim

Re: PID and/or handle assistance. . .?

2005-10-22 Thread Diez B. Roggisch
Michael Williams wrote: > Hi All, > > Can anyone explain how to both spawn processes from PYTHON and acquire > their process IDs or a handle to them for use later? I'd also like to > acquire the stdout of each spawned process. Google dead today? Well, check out the modules subprocess, popen2

PID and/or handle assistance. . .?

2005-10-22 Thread Michael Williams
Hi All, Can anyone explain how to both spawn processes from PYTHON and acquire their process IDs or a handle to them for use later? I'd also like to acquire the stdout of each spawned process. Regards, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a raised exception from other thread

2005-10-22 Thread dcrespo
> One suggestion about the above: "description" is actually the exception > instance (the object), not just the description. Yes. In fact, it's a tuple. Maybe, I'll change it for just printing the second item of it. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Listening for keypress in the background

2005-10-22 Thread Mathias Dahl
Peter Hansen <[EMAIL PROTECTED]> writes: >> How can I make it listen for a certain keypress (say, Windows-key + >> space) in a controlled fashion even when it is not the program having >> focus? >> >> I need to do this running under GNOME in Mandrake GN/Linux 10. > > Search Google for "python key

Re: best way to replace first word in string?

2005-10-22 Thread Chris F.A. Johnson
On 2005-10-22, William Park wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I am looking for the best and efficient way to replace the first word >> in a str, like this: >> "aa to become" -> "/aa/ to become" >> I know I can use spilt and than join them >> but I can also use regular express

Re: override a property

2005-10-22 Thread Kay Schluehr
Robin Becker wrote: > Kay Schluehr wrote: > > Robin Becker wrote: > > > > > >>I thought that methods were always overridable. > >>In this case the lookup on the > >>class changes the behaviour of the one and only property. > > > > > > How can something be made overridable that is actually overridab

Re: python problems with dos lineendings in python-scripts

2005-10-22 Thread Steve Holden
marco wrote: > hi folks, > > i can not run any python scripts with dos lineendings under cygwin's python. > if i run such a scripts i get stupid syntax error messages from python. > > what can i do to run these scripts without changing the lineending of these > scripts. > > regards marco > The

Re: Help with language, dev tool selection

2005-10-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have a flat text file, 3 records, each record has two columns, > the columns are tab separated. > > The file looks like this (approximately) > > Sarajevo 431104-133111 (when did they move sarajevo to italy?) > Mostar 441242-133421 > Zagreb 432322-134423 here's a

Re: Module Importing Question

2005-10-22 Thread Kent Johnson
James Stroud wrote: > Hello All, > > I have two modules that I use interchangably depending on the circumstances. > These modules are imported by yet another module. I want the "importation" of > these two alternatives to be mutually exclusive and dependent on the state of > the "outermost modu

pyHook example.py brakes windows dead keys mechanisme

2005-10-22 Thread Martin P. Hellwig
Hi all, I noticed that the "dead keys"* mechanism (XPSP2 NL, keyboard map US, input language Dutch) doesn't work when running the pyHooks (python 241) example. Instead of ö ("o) I immediately get ""o. If I close the pyHooks example the expected behavior returns. Is there a way how I can get bot

Re: C replacement for Queue module

2005-10-22 Thread Jason Lai
As far as Queues go, the adding/popping is apparently done with deque which are implemented in C. The Queue class pretty much just provides blocking operations and is otherwise a very thin layer around deque. As far as primitives go, only threading.Lock is written in C and the others are pure Pytho

Re: access dictionary with preferred order ?

2005-10-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am wondering if there is a dictionary data type that allows me to > define the order of access when iterating it using items/keys etc. ? > > An example: > > a=dict(a=dict(), c=dict(), h=dict()) > prefer=['e','h', 'a'] > > for x in a.values: print x > > would give me >

C extension modules in Python

2005-10-22 Thread luiscasanova
Hello, I'vre written an extension module to accelarate some code i've made in python with numarray. Then i compiled an linke d it with swig, my problem is that when i make the import in my python code it gives me an error: ImportError: libnumarray.so: cannot open shared object file: No such file o

Re: Listening for keypress in the background

2005-10-22 Thread Peter Hansen
Mathias Dahl wrote: > I have created a small Python program that is running on my desktop. > > How can I make it listen for a certain keypress (say, Windows-key + > space) in a controlled fashion even when it is not the program having > focus? > > I need to do this running under GNOME in Mandrake

Listening for keypress in the background

2005-10-22 Thread Mathias Dahl
I have created a small Python program that is running on my desktop. How can I make it listen for a certain keypress (say, Windows-key + space) in a controlled fashion even when it is not the program having focus? I need to do this running under GNOME in Mandrake GN/Linux 10. /Mathias -- http:/

Listening for a certain keypress in the background

2005-10-22 Thread Mathias Dahl
I have created a Python program that is running on my desktop. How can I make it listen for a certain keypress (say, Windows-key + space) in a controlled fashion even when it is not the program having focus? I need to do this running GNOME under Mandrake GN/Linux 10. /Mathias -- http://mail.p

Re: best way to replace first word in string?

2005-10-22 Thread Steven D'Aprano
On Sat, 22 Oct 2005 21:05:43 +1000, Steven D'Aprano wrote: > The thing is, a > *single* string concatenation is almost certainly more efficient than a > single string concatenation. Dagnabit, I meant a single string concatenation is more efficient than a single string replacement using %. -- S

Re: best way to replace first word in string?

2005-10-22 Thread Steven D'Aprano
On Thu, 20 Oct 2005 10:25:27 -0700, Micah Elliott wrote: > I thought that string concatenation was rather > expensive, so its being faster than %-formatting surprised me a bit: Think about what string concatenation actually does: s = "hello " + "world" In pseudo-code, it does something like th

Re: A question about searching with multiple strings

2005-10-22 Thread Steven D'Aprano
On Fri, 21 Oct 2005 13:39:17 -0700, googleboy wrote: > Hi there. > > I have defined a class called Item with several (about 30 I think) > different attributes (is that the right word in this context?). Generally speaking, attributes shouldn't be used for storing arbitrary items in an object. Tha

Re: A question about searching with multiple strings

2005-10-22 Thread Steven D'Aprano
On Fri, 21 Oct 2005 13:39:17 -0700, googleboy wrote: > > Hi there. > > I have defined a class called Item with several (about 30 I think) > different attributes (is that the right word in this context?). An > abbreviated example of the code for this is: > > class Item(object): > > def _

Re: C replacement for Queue module

2005-10-22 Thread Peter Hansen
Jonathan Ellis wrote: > I'm working on an application that makes heavy use of Queue objects in > a multithreaded environment. > > By "heavy" I mean "millions of calls to put and get, constituting ~20% > of the app's run time." The profiler thinks that a significant amount > of time is spent in th

[ANN] PyLint 0.8

2005-10-22 Thread Sylvain Thénault
Hi there ! I'm very please to announce the new 0.8 release of PyLint. I've promised this release for a long time now, and finally got the time to do it :D. This release includes a lot of bug fixes and enhancements. Notice that a major change in this release is a new dependancy to the astng package

[ANN] ASTNG 0.13

2005-10-22 Thread Sylvain Thénault
I'm please to announce the release of the Logilab's ASTNG package. This package has been extracted from the logilab-common package, which will be kept for some time for backward compatibility but will no longer be maintained (this explains that this package is starting with the 0.13 version number,

  1   2   >