Re: difference between class methods and instance methods

2005-02-18 Thread Antoon Pardon
Op 2005-02-17, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: > John wrote: >> ... hmm... bound methods get created each time you make >> a call to an instance method via an instance of the given class? > > No, they get created when you create an actual instance of an object. I'm not so sure about

Hello File.py

2005-02-18 Thread Lith
Here's a simple script, where I want to use a GUI to select a file. (And eventually do something interesting with it.) Some problems appear. (1) Why does it call MenuOpen automatically? (2) Why won't it open when I choose the menu item? (3) Python Cookbook gave me the sys.exit call, if I run it

Re: how can i randomly choose keys in dictionary

2005-02-18 Thread Thomas Guettler
Am Thu, 17 Feb 2005 18:13:46 -0800 schrieb neutrinman: > Hi,there. How can I choose a key in dictionary randomly? > > Say, random.choice() in lists, > > or in lists: > lists = [1,2,3,4] > position = random.range(len(lists)) > word = lists[position] Hi, try this: import random mydict={1: "one"

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-18 Thread Peter Maas
Terry Reedy schrieb: "Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] http://nobelprize.org/medicine/educational/pavlov/ and then do something useful :) Thanks. I showed this to my daughter, who enjoyed the game, and explained your point re Pavlov posting, and about Pav

wxPython and thread memory problems?

2005-02-18 Thread plumpy321
Hi, I took an example from wxPython with the IE web browser and created a refresh button to automatically refresh a web page in 5 second intervals. But I notice that the memory utilization in Python keeps increasing over time. Can anyone tell me why this is happening? Here is my code: ==

Re: Hello File.py

2005-02-18 Thread Eric Brunel
On 18 Feb 2005 00:17:01 -0800, Lith <[EMAIL PROTECTED]> wrote: Here's a simple script, where I want to use a GUI to select a file. (And eventually do something interesting with it.) Some problems appear. (1) Why does it call MenuOpen automatically? Because this code: menuFile.add_command(label=

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-18 Thread David Fraser
Stephen Kellett wrote: In message <[EMAIL PROTECTED]>, Ilias Lazaridis <[EMAIL PROTECTED]> writes This thread proofs simply the inability of this community [1] to focus on a simple essence. Incorrect analysis. This thread proves that you have no concept of how to interact with the community. I

Re: Access to formatting controls from within __repr__ or __str__?

2005-02-18 Thread Serge Orlov
Dan Sommers wrote: > So my question is: Is there a way to pass options "through" a format > string to the __str__ and __repr__ functions? For example, can I > define my own alternate form for use with the '#' formatting > character, so that '%#s' generates output according to SI guidelines? Yo

Re: PythonCard and Py2Exe

2005-02-18 Thread PipedreamerGrey
I am using the command prompt. What I realized after reading your entry, Peter, is that if I use "setup.py py2exe" instead of "start setup.py py2exe" I can see the error in the same window without it closing. I went into the script and double spaced everything in case Notebook smashed the lines

Re: difference between class methods and instance methods

2005-02-18 Thread Duncan Booth
John wrote: >>inst = C() >>f1 = inst.foo >>f2 = inst.foo >>f1, f2 >> >> (>, > method C.foo of <__main__.C instance at 0x00B03F58>>) >> > > I just wanted to interject, although those two hex > numbers in the above line are the same, calling > id() on f1 and f2 produces two *different* numbers, >

combining several lambda equations

2005-02-18 Thread Paddy McCarthy
Hi, I am trying to use eval as little as possible but solve this problem. #If given:two or more lambda equations x=lambda : A < B y=lambda : C+6 >= 7 ... How do I create another lambda expression Z equivalent to Z=lambda : (A=7) # i.e. the anding together of the originals, but without referenc

COM+metaclass+property issue

2005-02-18 Thread Thomas Lilley
I'm trying to manufacture a class that provides attributes which mimic the HTML collections offered by the Internet Explorer COM object.  My platform is Win32 (Windows XP) and ActiveState's latest Python 2.3.  The problem is, my attributes are based on properties, which work fine except for when I

Re: combining several lambda equations

2005-02-18 Thread Fredrik Lundh
Paddy McCarthy wrote: > #If given:two or more lambda equations > x=lambda : A < B > y=lambda : C+6 >= 7 > > How do I create another lambda expression Z equivalent to > > Z=lambda : (A=7) > > # i.e. the anding together of the originals, but without referencing > # globals x and y as they are artifi

Re: low-end persistence strategies?

2005-02-18 Thread Paul Rubin
Pierre Quentel <[EMAIL PROTECTED]> writes: > Even if the 12 requests occur in the same 5 minutes, the time needed > for a read or write operation on a small base of any kind (flat file, > dbm, shelve, etc) is so small that the probability of concurrence is > very close to zero I prefer "equal to z

Re: low-end persistence strategies?

2005-02-18 Thread Nick Craig-Wood
Michele Simionato <[EMAIL PROTECTED]> wrote: > Ok, I have yet another question: what is the difference > between fcntl.lockf and fcntl.flock? The man page of > my Linux system says that flock is implemented independently > of fcntl, however it does not say if I should use it in preference > o

Re: Help needed for to build a CGI shell interface.

2005-02-18 Thread Fuzzyman
Tim Roberts wrote: > Slalomsk8er <[EMAIL PROTECTED]> wrote: > > > >What do I want to do? I am building an admintool (deamon and client) and > >for this I need to script a interface to the shell, with the console > >ansi escape sequences, whitch is fully transparent for the user. > > Do you honest

Re: combining several lambda equations

2005-02-18 Thread paddy3118
Fredrik Lundh wrote: > Paddy McCarthy wrote: > > > #If given:two or more lambda equations > > x=lambda : A < B > > y=lambda : C+6 >= 7 > > > > How do I create another lambda expression Z equivalent to > > > > Z=lambda : (A=7) > > > > # i.e. the anding together of the originals, but without referenc

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-18 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, David Fraser <[EMAIL PROTECTED]> writes Actually I suspect Ilias is trying to carry out his own sort of 'survey' on how various communities respond to questions asked in the kind of way he asked them ... See his web site. Its as unreadable as his network news post

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-18 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Peter Maas <[EMAIL PROTECTED]> writes Perhaps we will soon see a triumphant publication with the title "Ilias Lazaridis - the ELIZA of the 21st century. A milestone towards the perfect Turing test" ;) I've got to admit that for a large proportion of the time interac

Re: Python, Matlab and AI question

2005-02-18 Thread Robert Kern
dataangel wrote: I'm a student who's considering doing a project for a Machine Learning class on pathing (bots learning to run through a maze). The language primarily used by the class has been Matlab. I would prefer to do the bulk of the project in python because I'm familiar with pygame (for t

Re: How do I make my program start fullscreen ?

2005-02-18 Thread dimitri pater
If you're using Tkinter, the next url might help: http://effbot.org/zone/tkinter-toplevel-fullscreen.htm On Tue, 15 Feb 2005 23:35:05 +0100, BOOGIEMAN <[EMAIL PROTECTED]> wrote: > os = windows xp > How do I make "myprogram.py" start fullscreen at windows command prompt ? > Also I made it as "mypr

Re: combining several lambda equations

2005-02-18 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I actually have a set of lambdas so my use will be more like: A set of lambdas gains you nothing. >>> (lambda: a > 0) in set([lambda: a > 0]) False is probably not what you expected. So you might want to go back to strings containing expressions. Anyway, here is a way

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-18 Thread Diez B. Roggisch
Thomas Heller wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >> Maybe somehow the pygame sdl wrapper can be used for gui-stuff. SDL has >> had a DOS mode. But it is discontinued. > > What exactly is discontinued? pygame? SDL? The dos mode of sdl. -- Regards, Diez B. Roggisch -- h

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-18 Thread Neil Hodgson
Peter Maas: > Perhaps we will soon see a triumphant publication with the title > "Ilias Lazaridis - the ELIZA of the 21st century. A milestone towards > the perfect Turing test" ;) as laridis Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT]: Re: Why doesn't join() call str() on its arguments?

2005-02-18 Thread Nick Vargish
"news.sydney.pipenetworks.com" <[EMAIL PROTECTED]> writes: > I'm sure theres got to be a few copy cats in those 12 though. Those that don't come up with original answers alter the existing ones a bit and call it their own. > Does that mean you just haven't had time to finish ? or you have been >

Re: difference between class methods and instance methods

2005-02-18 Thread Diez B. Roggisch
> This is badly wrong. John was correct. > > Bound methods get created whenever you reference a method of an instance. > If you are calling the method then the bound method is destroyed as soon > as the call returns. You can have as many different bound methods created > from the same unbound meth

Solution for architecure dependence in Numeric ?

2005-02-18 Thread Johannes Nix|Johannes.Nix
Hi, I have a tricky problem with Numeric. Some time ago, I have generated a huge and complex data structure, and stored it using the cPickle module. Now I want to evaluate it quickly again on a workstation cluster with 64-Bit Opteron CPUs - I have no more than three days to do this. Compiling Pyt

Re: Py2exe and extension issues

2005-02-18 Thread kdahlhaus
John, Thanks, for some reason, I just saw your response. I'll be getting back to that app in about 2 week and the first item is to look into the issue. -- http://mail.python.org/mailman/listinfo/python-list

Re: Solution for architecure dependence in Numeric ?

2005-02-18 Thread Michael Spencer
"Johannes Nix|Johannes.Nix"@uni-oldenburg.de wrote: Hi, I have a tricky problem with Numeric. Some time ago, I have generated a huge and complex data structure, and stored it using the cPickle module. Now I want to evaluate it quickly again on a workstation cluster with 64-Bit Opteron CPUs - I have

Re: Solution for architecure dependence in Numeric ?

2005-02-18 Thread Paul Rubin
Johannes Nix |[EMAIL PROTECTED]> writes: > So what would you suggest ? Can I hack Numeric to assume non-native > 32 bit integer numbers ? I think it would be better to fix the pickle/cPickle module to correctly unpack the 32-bit ints on your 64 bit machine. -- http://mail.python.org/mailman/listi

Annoying Socket Problem

2005-02-18 Thread John Abel
I'm hoping this is something simple, and someone can point me in the right direction here. I have a class based on SocketServer (ThreadingTCPServer), and I've used makefile on the socket so I use the "for in " routine. My client sends it a small amount of data. However, both programs appear

Re: low-end persistence strategies?

2005-02-18 Thread John Lenton
On Thu, Feb 17, 2005 at 10:20:58PM -0800, Michele Simionato wrote: > Ok, I have yet another question: what is the difference > between fcntl.lockf and fcntl.flock? The man page of > my Linux system says that flock is implemented independently > of fcntl, however it does not say if I should use it

Re: how can i randomly choose keys in dictionary

2005-02-18 Thread John Lenton
On Fri, Feb 18, 2005 at 09:35:30AM +0100, Thomas Guettler wrote: > Am Thu, 17 Feb 2005 18:13:46 -0800 schrieb neutrinman: > > > Hi,there. How can I choose a key in dictionary randomly? > > > > Say, random.choice() in lists, > > > > or in lists: > > lists = [1,2,3,4] > > position = random.range(l

Re: Annoying Socket Problem

2005-02-18 Thread Irmen de Jong
John Abel wrote: I'm hoping this is something simple, and someone can point me in the right direction here. I have a class based on SocketServer (ThreadingTCPServer), and I've used makefile on the socket so I use the "for in " routine. My client sends it a small amount of data. However, both

Re: difference between class methods and instance methods

2005-02-18 Thread Duncan Booth
Diez B. Roggisch wrote: >> This is badly wrong. John was correct. >> >> Bound methods get created whenever you reference a method of an >> instance. If you are calling the method then the bound method is >> destroyed as soon as the call returns. You can have as many different >> bound methods cre

Re: [perl-python] exercise: partition a list by equivalence

2005-02-18 Thread anton muhin
Xah Lee wrote: here's another interesting algorithmic exercise, again from part of a larger program in the previous series. Here's the original Perl documentation: =pod merge($pairings) takes a list of pairs, each pair indicates the sameness of the two indexes. Returns a partitioned list of same in

Re: difference between class methods and instance methods

2005-02-18 Thread Antoon Pardon
Op 2005-02-18, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: >> This is badly wrong. John was correct. >> >> Bound methods get created whenever you reference a method of an instance. >> If you are calling the method then the bound method is destroyed as soon >> as the call returns. You can have as

How to save an image created from multiple images?

2005-02-18 Thread Antti Isomursu
Ok, this is my problem: I have succesfully created an image by pasting smaller images into area, created with canvas method: >>> canvas = Canvas(win, width=canvasX, height=canvasY, background='white') """ Then I add images to picture using line below """ >>> canvas.create_image(ax, yy, anchor='nw'

Re: having troubleing finding package for Twisted 1.3 for Mac OS X 10.3.x

2005-02-18 Thread John
fuzzylollipop wrote: just got a Powerbook and need to do twisted development on it, but I can't find a simple straight foward instructions on installing Twisted 1.3 on it. Also the package manager at undefined.org has 1.1.0 and it doesn't work with 10.3.x ( pre-installed Python ) any help is welcom

Re: Annoying Socket Problem

2005-02-18 Thread John Abel
Read/tried that before posting. Even with a flush, everything hangs until I kill the client. Irmen de Jong wrote: John Abel wrote: I'm hoping this is something simple, and someone can point me in the right direction here. I have a class based on SocketServer (ThreadingTCPServer), and I've use

Chart Director?

2005-02-18 Thread kdahlhaus
Does anyone here have experience with Chart Director (http://www.advsofteng.com/index.html)? I'm thinking about purchasing it and looking for any feedback from the Python community. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Platform independent adduser script?

2005-02-18 Thread morphex
Hi there, does anyone here know of a script that enables adding of users on UNIX platforms via python? Thanks, Morten -- http://mail.python.org/mailman/listinfo/python-list

Re: Platform independent adduser script?

2005-02-18 Thread Grant Edwards
On 2005-02-18, morphex <[EMAIL PROTECTED]> wrote: > Hi there, > > does anyone here know of a script that enables adding of users on UNIX > platforms via python? os.system("adduser ... ") ? The way that users are added on "UNIX platforms" varies. Most (Linux, BSD, Solaris) seem to have an "adduse

interface like behavior for mudules

2005-02-18 Thread paolo_veronelli
Hello pyple, I have two modules :remote.py and local.py which have some classes with the same names specifically one we can call Model.So it exist remote.Model class and local.Model class A third module called uri.py derives some of its classes from a not better specified repository.Model a

3d graphics

2005-02-18 Thread Eric Hanson
Hi, I'm interested in doing some work with 3d graphics visualizations of XML/RDF data in Python. I know Python is strong on the XML front but what about 3d graphics? Is there a graphics library out there with graphics library with a fairly gradual learning curve? Do people actually use Python f

Re: low-end persistence strategies?

2005-02-18 Thread Michele Simionato
Uhm ... I reading /usr/src/linux-2.4.27/Documentation/mandatory.txt The last section says: """ 6. Warning! --- Not even root can override a mandatory lock, so runaway processes can wreak havoc if they lock crucial files. The way around it is to change the file permissions (remove the setg

Re: msnp, friends list

2005-02-18 Thread jr
Mark, Thank you so much for that information. Been struggling with this issue for quite some time now. A simle line comment on line 647 of session.py solves all problems :) this line sets your status to online and does not get time (usually) to get friends list correctly. -- http://mail.python.or

Re: [perl-python] exercise: partition a list by equivalence

2005-02-18 Thread John Lenton
On Thu, Feb 17, 2005 at 03:46:20PM -0800, Xah Lee wrote: > here's another interesting algorithmic exercise, again from part of a > larger program in the previous series. > > Here's the original Perl documentation: > > =pod > > merge($pairings) takes a list of pairs, each pair indicates the > sam

Re: low-end persistence strategies?

2005-02-18 Thread John Lenton
On Fri, Feb 18, 2005 at 07:57:21AM -0800, Michele Simionato wrote: > Uhm ... I reading /usr/src/linux-2.4.27/Documentation/mandatory.txt > The last section says: > > """ > 6. Warning! > --- > > Not even root can override a mandatory lock, so runaway processes > can wreak havoc if they loc

Re: Help with research

2005-02-18 Thread Jack Diederich
On Thu, Feb 17, 2005 at 07:09:44PM -0500, Jeremy Bowers wrote: > On Thu, 17 Feb 2005 15:51:47 -0800, elena wrote: > > I can go to my friends, however it occurred to me that it might be > > better to post in a newsgroup and get a larger, more diverse, and > > random sample. > > Larger, yes, more d

Re: 3d graphics

2005-02-18 Thread Mike C. Fletcher
Eric Hanson wrote: Hi, I'm interested in doing some work with 3d graphics visualizations of XML/RDF data in Python. I know Python is strong on the XML front but what about 3d graphics? Is there a graphics library out there with graphics library with a fairly gradual learning curve? Do people act

WebServices/SOAP/Zolera Arghhhhhhhhh!!!!!!...not so much

2005-02-18 Thread Tom Willis
I am not a SOAP/Web Services expert!! But I had to interface with some webservice code here at work. I was reading on the net the complextypes didn't work or were finnicky etc Well I managed to get it to work on Zolera 1.7. First the code generated from the wsdl didn't work without some e

DB Schema

2005-02-18 Thread Gabriel B.
I started to use dbschema.com but it has some big flaws (mainly regarding keys and mysql) and besides it's being in java (wich i don't like to code at all) it's closed source. I'm considering starting a new GPL one in python, so, i ask if you people already know a project like that. Thanks, Gabri

Newbie CGI problem

2005-02-18 Thread Rory Campbell-Lange
#!/usr/bin/python import cgi print "Content-type: text/html\n\n" print "hi" Gives me the following in my browser: ''' hi Content-type: text/html hi ''' Why are there two 'hi's? Thanks, Rory -- Rory Campbell-Lange <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

unicode encoding usablilty problem

2005-02-18 Thread aurora
I have long find the Python default encoding of strict ASCII frustrating. For one thing I prefer to get garbage character than an exception. But the biggest issue is Unicode exception often pop up in unexpected places and only when a non-ASCII or unicode character first found its way into the

Re: Newbie CGI problem

2005-02-18 Thread aurora
Not sure about the repeated hi. But you are supposed to use \r\n\r\n, not just \n\n according to the HTTP specification. #!/usr/bin/python import cgi print "Content-type: text/html\n\n" print "hi" Gives me the following in my browser: ''' hi Content-type: text/html hi ''' Why are there two 'hi's

Re: difference between class methods and instance methods

2005-02-18 Thread Steven Bethard
Duncan Booth wrote: Diez B. Roggisch wrote: Duncan Booth wrote: Bound methods get created whenever you reference a method of an instance. That did escape me so far - interesting. Why is it that way? I'd expect that creating a bound method from the class and then storing it in the objects dictionary

Re: combining several lambda equations

2005-02-18 Thread Steven Bethard
Paddy McCarthy wrote: x=lambda : A < B y=lambda : C+6 >= 7 [snip] Z=lambda : (A=7) See "Inappropriate use of Lambda" in http://www.python.org/moin/DubiousPython Perhaps your real example is different, but notice that = lambda : is equivalent to def (): return except that the latt

Re: Newbie CGI problem

2005-02-18 Thread Peter Otten
Rory Campbell-Lange wrote: > #!/usr/bin/python > import cgi > print "Content-type: text/html\n\n" > print "hi" > > Gives me the following in my browser: > > ''' > hi > Content-type: text/html > > > hi > ''' > > Why are there two 'hi's? You have chosen a bad name for your script: cgi.py. It i

Re: low-end persistence strategies?

2005-02-18 Thread pyguy2
You do not need to use a 24/7 process for low end persistance, if you rely on the fact that only one thing can ever succeed in making a directory. If haven't seen a filesystem where this isn't the case. This type of locking works cross-thread/process whatever. An example of that type of locking c

Re: Newbie CGI problem

2005-02-18 Thread m
m wrote: gives just one hi for me. " Content-type: text/html hi " I get this -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie CGI problem

2005-02-18 Thread m
Rory Campbell-Lange wrote: #!/usr/bin/python import cgi print "Content-type: text/html\n\n" print "hi" Gives me the following in my browser: ''' hi Content-type: text/html hi ''' Why are there two 'hi's? Thanks, Rory gives just one hi for me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Probably over my head... Trying to get Font Names

2005-02-18 Thread Mike C. Fletcher
[Samantha: your email has been bouncing, might want to clear your inbox] Samantha wrote: Thanks Mike. I must have not installed the ttfquery and font tools correctly. I get an error. This error: ... ImportError: No module named fontTools Like I said I think I am way in over my short head. S

Re: Newbie CGI problem

2005-02-18 Thread aurora
On Fri, 18 Feb 2005 18:36:10 +0100, Peter Otten <[EMAIL PROTECTED]> wrote: Rory Campbell-Lange wrote: #!/usr/bin/python import cgi print "Content-type: text/html\n\n" print "hi" Gives me the following in my browser: ''' hi Content-type: text/html hi ''' Why are there two 'hi's? You have chosen a ba

Re: Probably over my head... Trying to get Font Names

2005-02-18 Thread Samantha
Mike, Not sure why that email bounced. I downloaded these files: WinTTX2.0b1.exe TTFQuery-1.0.0.win32.exe numarray-1.1.1.win32-py2.4.exe They all seemed to install. Is WinTTX2.0b1.exe not the fontTools file? S "Mike C. Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [Sama

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-18 Thread Ilias Lazaridis
[this is a summary of a private conversation that I had with the developer of the phMinGW. It contains just my comments. I've send additionally a CC via email (private-to-public switch notification)] - A.B., Khalid wrote: [...] Khalid, first of all I like to thank you for the efforts you have ta

re.compile and very specific searches

2005-02-18 Thread rbt
Is it possible to use re.compile to exclude certain numbers? For example, this will find IP addresses: ip = re.compile('\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}') But it will also find 999.999.999.999 (something which could not possibly be an IPv4 address). Can re.compile be configured to filter results

wxPython demo /Process does not open new demo

2005-02-18 Thread Andy Leszczynski
Try to run wxPython 2.5 (for python 2.3) demo. Then Open Process and Events/Process. Type in "python -u demo.py" and wait. There is a splash screen but nothing more. Why? Regards,A. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython demo /Process does not open new demo

2005-02-18 Thread Andy Leszczynski
Andy Leszczynski wrote: Try to run wxPython 2.5 (for python 2.3) demo. Then Open Process and Events/Process. Type in "python -u demo.py" and wait. There is a splash screen but nothing more. Why? Regards,A. Forgot to add that it happnes on Win2K. -- http://mail.python.org/mailman/listinfo/python-

Re: unicode encoding usablilty problem

2005-02-18 Thread Fredrik Lundh
anonymous coward <[EMAIL PROTECTED]> wrote: > This brings up another issue. Most references and books focus exclusive on > entering unicode > literal and using the encode/decode methods. The fallacy is that string is > such a basic data type > use throughout the program, you really don't wa

Re: having troubleing finding package for Twisted 1.3 for Mac OS X 10.3.x

2005-02-18 Thread fuzzylollipop
nope I was hoping there was a more "mac" way of doing that :-) I will research that and see what I can get to work, I am born-again Mac user ( last machine was a 7200 ) just got a PowerBook so I am in re-learn mode again ( am familiar with Unix that is why I wanted the PowerBook as a change of pac

Re: "Best" way to SIGHUP spamd from web page?

2005-02-18 Thread stephen
Webmin (webmin.com) has a command shell module (cgi over https?). Isn't this an example of a secure way to run commands via the internet? Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: re.compile and very specific searches

2005-02-18 Thread Diez B. Roggisch
rbt wrote: > Is it possible to use re.compile to exclude certain numbers? For > example, this will find IP addresses: > > ip = re.compile('\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}') > > But it will also find 999.999.999.999 (something which could not > possibly be an IPv4 address). Can re.compile be conf

Re: move bugs from Zope BITS into Bugzilla?

2005-02-18 Thread lmhaskins
Does it import from BITS? -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode encoding usablilty problem

2005-02-18 Thread aurora
On Fri, 18 Feb 2005 19:24:10 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: that's how you should do things in Python too, of course. a unicode string uses unicode internally. decode on the way in, encode on the way out, and things just work. the fact that you can mess things up by mixing u

duplicate docstrings

2005-02-18 Thread Steven Bethard
I have two classes that implement the same interface, e.g. something like: class C(object): def foo(self): """Foo things""" ... def bar(self): """Bar things""" ... def baz(self): """Baz things in a C manner""" ... class D(object): def

Re: Probably over my head... Trying to get Font Names

2005-02-18 Thread Fredrik Lundh
"Samantha" <[EMAIL PROTECTED]> wrote: >I am attempting to extract the Font Names from the installed windows fonts. I >am having a heck of a >time getting these rather than the file names. Examples can be seen by going >to Control Panel > >Fonts here's one way to do it (using Tkinter): >>> im

unicode and socket

2005-02-18 Thread zyqnews
hello all, I am new in Python. And I have got a problem about unicode. I have got a unicode string, when I was going to send it out throuth a socket by send(), I got an exception. How can I send the unicode string to the remote end of the socket as it is without any conversion of encode, so the re

Re: unicode encoding usablilty problem

2005-02-18 Thread Walter Dörwald
aurora wrote: > [...] In Java they are distinct data type and the compiler would catch all incorrect usage. In Python, the interpreter seems to 'help' us to promote binary string to unicode. Things works fine, unit tests pass, all until the first non-ASCII characters come in and then the prog

RE: "Best" way to SIGHUP spamd from web page?

2005-02-18 Thread Robert Brewer
[EMAIL PROTECTED] wrote: > Webmin (webmin.com) has a command shell module (cgi over > https?). Isn't this an example of a secure way to run > commands via the internet? Yes, if I wanted to write my app in Perl 5. ;) But as far as I can tell, that relies heavily on Perl's taint-checking, which isn

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-18 Thread Josef Meile
It looks like here the only worth words are yours. Didn't you close this thread? I will refresh your mind with your own unpolite way: """ Ilias Lazaridis wrote: [...] closing thread http://groups-beta.google.com/group/comp.lang.python/msg/f2ae9cdbe16676d1 """ Anyway, I will add some comments: The d

Re: unicode and socket

2005-02-18 Thread aurora
You could not. Unicode is an abstract data type. It must be encoded into octets in order to send via socket. And the other end must decode the octets to retrieve the unicode string. Needless to say the encoding scheme must be consistent and understood by both ends. On 18 Feb 2005 11:03:46 -0

Re: Probably over my head... Trying to get Font Names

2005-02-18 Thread Mike C. Fletcher
Samantha wrote: Mike, Not sure why that email bounced. That last one bounced too, btw. I downloaded these files: WinTTX2.0b1.exe TTFQuery-1.0.0.win32.exe numarray-1.1.1.win32-py2.4.exe They all seemed to install. Is WinTTX2.0b1.exe not the fontTools file? I believe WinTTX is a font-editing pr

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-18 Thread Ilias Lazaridis
Josef Meile wrote: It looks like here the only worth words are yours. Didn't you close this thread? yes, but when reviewing again I found this lack [created by myself due to private conversation]. I will refresh your mind with your own unpolite way: I find this very polite [to notify conversation

Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-18 Thread Alec Wysoker
I need to be able to access mySQL 4.0 and 4.1 databases from python. I was hoping to find mysql-python 1.2.0 already built for Sparc, but no such luck. I've been struggling trying to get it build. First, I had to hack setup.py because mysql_config --cflags was returning -m64, which wasn't right

Re: Probably over my head... Trying to get Font Names

2005-02-18 Thread Pierre Quentel
"Samantha" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > I am attempting to extract the Font Names from the installed windows fonts. > I am having a heck of a time getting these rather than the file names. > Examples can be seen by going to Control Panel > Fonts > > Any help

Re: Trying to get Font Names

2005-02-18 Thread Samantha
Thanks Fredrik, The Tkinter method didn't give any results but using PIL did. I'll have to play with it a little. Thanks again, S "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Samantha" <[EMAIL PROTECTED]> wrote: > -- http://mail.python.org/mailman/listinfo/pyt

Re: Probably over my head... Trying to get Font Names

2005-02-18 Thread Samantha
Mike, Strange Hotmail. I'll start over with the installs and you are correct on it being Numpy. I got the wrong file. I'll give it a go and let you know. Thanks S "Mike C. Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Samantha wrote: > -- http://mail.python.org/ma

selecting dictionaries to maximize counts

2005-02-18 Thread Steven Bethard
I have a list of dictionaries. Each dictionary holds counts of various 'words', e.g.: py> countdicts = [ ... dict(a=9, b=9, c=9), ... dict(a=8, b=7), ... dict(a=4, b=5, c=12)] I need to select dicts with the constraint that the number of each 'word' totalled over all selected dicts

Re: unicode encoding usablilty problem

2005-02-18 Thread Jarek Zgoda
Fredrik Lundh napisał(a): This brings up another issue. Most references and books focus exclusive on entering unicode literal and using the encode/decode methods. The fallacy is that string is such a basic data type use throughout the program, you really don't want to make a individual decisio

Re: unicode encoding usablilty problem

2005-02-18 Thread Thomas Heller
=?ISO-8859-15?Q?Walter_D=F6rwald?= <[EMAIL PROTECTED]> writes: > aurora wrote: > > > [...] >> In Java they are distinct data type and the compiler would catch all >> incorrect usage. In Python, the interpreter seems to 'help' us to >> promote binary string to unicode. Things works fine, unit tes

Re: unicode encoding usablilty problem

2005-02-18 Thread "Martin v. Löwis"
aurora wrote: The Java has a much more usable model with unicode used internally and encoding/decoding decision only need twice when dealing with input and output. In addition to Fredrik's comment (that you should use the same model in Python) and Walter's comment (that you can enforce it by s

help for xml parsing error

2005-02-18 Thread Michael Zhang
Hi, I got a strange error of my python program. The program is trying to load some data from server (also built in Python). the data is in xml format. After calling xml parser, I got the following error: File "ShowAll.py", line 156, in ? main(sys.argv) File "ShowAll.py", line 129, in ma

extracting HTML fragments and counting words

2005-02-18 Thread Ksenia Marasanova
Hi, I want to show preview of several HTML formatted newsitems on one page, preserving markup (and images) intact, but showing not more thatn X first _readable_ words of every page. Is anyone aware of some Python library that makes programming this easy? I already started to program it with Beaut

Re: unicode encoding usablilty problem

2005-02-18 Thread Jarek Zgoda
Walter Dörwald napisał(a): Is there a scheme for Python developer to use so that they are safe from incorrect mixing? Put the following: import sys sys.setdefaultencoding("undefined") in a file named sitecustomize.py somewhere in your Python path and Python will complain whenever there's an impl

Re: Access to formatting controls from within __repr__ or __str__?

2005-02-18 Thread Dan Sommers
On 18 Feb 2005 01:25:06 -0800, "Serge Orlov" <[EMAIL PROTECTED]> wrote: > Dan Sommers wrote: >> So my question is: Is there a way to pass options "through" a format >> string to the __str__ and __repr__ functions? For example, can I >> define my own alternate form for use with the '#' formattin

Re: unicode encoding usablilty problem

2005-02-18 Thread Thomas Heller
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> writes: > We have come up with a transition strategy, allowing existing > libraries to widen their support from byte strings to character > strings. This isn't a simple task, so many libraries still expect > and return byte strings, w

Re: Python, Matlab and AI question

2005-02-18 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > dataangel wrote: >> I'm a student who's considering doing a project for a Machine Learning class >> on pathing (bots learning to run through a maze). The language primarily >> used by the class has been Matlab. I would prefer to do the bulk of the >> proje

Re: re.compile and very specific searches

2005-02-18 Thread John Machin
Diez B. Roggisch wrote: > So I'd suggest you dump re and do it like this: > > address = "192.168.1.1" > > def validate_ip4(address): > digits = address.split(".") > if len(digits) == 4: > for d in digits: > if int(d) < 0 or int(d) > 255: > return Fals

Re: unicode encoding usablilty problem

2005-02-18 Thread Thomas Heller
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> writes: > Eventually, the primary string type should be the Unicode > string. If you are curious how far we are still off that goal, > just try running your program with the -U option. Not very far - can't even call functions ;-) c:

  1   2   >