lambda closure question

2005-02-18 Thread Ted Lilley
What I want to do is pre-load functions with arguments by iterating through a list like so: >>>class myclass: ...pass >>>def func(self, arg): ...print arg >>>mylist = ["my", "sample", "list"] >>>for item in mylist: ...setattr(myclass, item, lamdba self: func(self, item)) This attaches

Re: Chart Director?

2005-02-18 Thread Vincent Wehren
[EMAIL PROTECTED] wrote: 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 Since ChartDirector is not exactly open source nor found its origin in a Python s

Re: exercise: partition a list by equivalence

2005-02-18 Thread John Lenton
On Fri, Feb 18, 2005 at 09:57:59PM -0800, John Machin wrote: > > > > this, together with you saying that it is hard to explain, makes me > > think that you aren't comfortable thinking of lists as mutable > > objects. > > How so? There is no connection between is/== and mutability. Let me > amplify

Re: combining several lambda equations

2005-02-18 Thread Paddy
Steve, Thanks for the info but I do know about that.. What I am doing is taking a set of inputted functions that don't take arguments and programmatically analysing them and combining them to create new functions that are further analysed. During testing I keep the numbers low, and am only dealing

Re: exercise: partition a list by equivalence

2005-02-18 Thread John Machin
John Lenton wrote: > On Fri, Feb 18, 2005 at 04:52:46PM -0800, John Machin wrote: > > > > needs "if rev[first] == rev[second]: continue" here > > > > > > an 'is' is enough, and better. > > > > Good point. You're redeeming yourself :-) > > this, together with you saying that it is hard to explain,

Re: Test for structure

2005-02-18 Thread Terry Hancock
On Wednesday 16 February 2005 09:08 am, alex wrote: > how can I check if a variable is a structure (i.e. a list)? For my > special problem the variable is either a character string OR a list of > character strings line ['word1', 'word2',...] > > So how can I test if a variable 'a' is either a sing

Re: Variables.

2005-02-18 Thread Terry Hancock
On Wednesday 16 February 2005 03:34 am, administrata wrote: > sry, I mean the problem is... about lining > > it doesn't look like this... > > Allen woke up early in the morning. But, it was unusal by Allen. > Allen's pillow was with Allen. Allen didn't want to wake up But, Allen > tried my best a

Re: xmlrpc.server.work() does not seem to handle multiple requests

2005-02-18 Thread Adonis
john14 wrote: Hi, I have an xmlrpc server. I using the python package xmlrpc. Here is what I am doing: s = xmlrpc.server() s.addMethods(method_hash) s.bindAndListen(PORT) while 1: try: s.work() except: e = sys.exc_info() The problem is that wh

newbie question on python 2.4 and tkinter

2005-02-18 Thread David Joyner
Hi: I'm trying to compile python 2.4 with tkinter. (I'm trying to write a gui interface which calls a program called GAP - I'm hoping to use subprocess, a python 2.4 module, since I was getting deadlocks using popen). The instructions at the python web site said basically to edit the /Modules/Setup

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-18 Thread ? the Platypus {aka David Formosa}
Ilias Lazaridis <[EMAIL PROTECTED]> writes: > Duncan Booth wrote: [...] > > It is GPL licensed with an amendment which prevents the GPL > > spreading to other open source software with which it is linked. > > "In accordance with section 10 of the GPL, Red Hat, Inc. permits > > programs whose sour

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

2005-02-18 Thread Samantha
Thank you Pierre, that worked. I am still going to try and get the TTFQuery+Fonttools to work just out of curiosity. Thanks again to everyone!!! S "Pierre Quentel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Samantha" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTEC

Re: exercise: partition a list by equivalence

2005-02-18 Thread David Eppstein
In article <[EMAIL PROTECTED]>, David Eppstein <[EMAIL PROTECTED]> wrote: > It can be solved by union-find > (e.g. with UnionFind from ): Here's a cleaned up version, after I added a proper iter() method to the UnionFind data structure: import UnionFind

Re: unicode and socket

2005-02-18 Thread zyqnews
It's really funny, I cannot send a unicode stream throuth socket with python while all the other languages as perl,c and java can do it. then, how about converting the unicode string to a binary stream? It is possible to send a binary through socket with python? -- http://mail.python.org/mailman/

Re: exercise: partition a list by equivalence

2005-02-18 Thread John Lenton
On Fri, Feb 18, 2005 at 04:52:46PM -0800, John Machin wrote: > > > needs "if rev[first] == rev[second]: continue" here > > > > an 'is' is enough, and better. > > Good point. You're redeeming yourself :-) this, together with you saying that it is hard to explain, makes me think that you aren't com

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

2005-02-18 Thread Brian Beck
Well, it looks like David posted a good solution, but I haven't tested it (I'm assuming his works fine). I fixed mine up anyway... it actually works now. If you're not using 2.4 you'll have to import sets.Set as set. def merge(pairList): pairList = set(tuple(sorted(p)) for p in pairList)

Report

2005-02-18 Thread herring
Your message was not delivered due to the following reason: Your message was not delivered because the destination server was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there

Re: exercise: partition a list by equivalence

2005-02-18 Thread David Eppstein
In article <[EMAIL PROTECTED]>, "John Machin" <[EMAIL PROTECTED]> wrote: > You don't need to think. This problem has been extensively picked over > by folk who are a lot smarter than us, starting from 30 years ago. > Google for "disjoint set" and "union-find". One gets the impression > that the b

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-18 Thread Michael Hoffman
Alec Wysoker wrote: 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. Try version 1.0.1. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Matplotlib, py2exe and pytz

2005-02-18 Thread scott
I am trying to convert a python app that uses matplotlib to a standalone executable using py2exe. After running py2exe and executing my app I get the following stack trace: Traceback (most recent call last): File "gcToCsv.py", line 5, in ? File "plot_output.pyc", line 1, in ? File "pylab.py

Can I get message filename from a Maildir mailbox stream?

2005-02-18 Thread noah
Is there a way to figure out what filename an email object points to in a qmail style Maildir directory? Hmmm... I don't think so, but I'm hoping I wrong. I instantiated a Maildir mailbox and I'm iterating through the messages. When I find a special message I want to move it or delete it or somet

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

2005-02-18 Thread Brian Beck
Brian Beck wrote: Brian Beck wrote: > [code] Ah heck, nevermind... it worked for my small test cases but the algorithm is just wrong. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

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

2005-02-18 Thread Brian Beck
Brian Beck wrote: > [code] Whoops, that should say: def merge(pairs): pairs = set(tuple(sorted(p)) for p in pairs) merged = [] # Each loop will result in a new, complete sublist in the result. while pairs: p = set(pairs.pop()) remove = set([]) for pair in pai

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

2005-02-18 Thread Brian Beck
Xah Lee wrote: merge($pairings) takes a list of pairs, each pair indicates the sameness of the two indexes. Returns a partitioned list of same indexes. For example, if the input is merge( [ [1,2], [2,4], [5,6] ] ); that means 1 and 2 are the same. 2 and 4 are the same. Therefore 1==2==4. The result

www.bidfraud.com "Grand Opening" -- Read Inside for capabilities

2005-02-18 Thread bidfraud
www.bidfraud.com "Grand Opening" -- Read Inside for capabilities After 1000 plus hours in development - Bidfraud.com is "breathing." http://www.bidfraud.com Features: Capable of archiving ebay auction transactions locally on our server. This is important, as ebay deletes transactions every few

Re: Python, Matlab and AI question

2005-02-18 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > >> Actually, I've written a highlevel matlab-python bridge (based on bugfixed >> and >> slightly extended version of the original pymat) which is quite up-to-date; >> by >> and large it makes using matlab from python as easy a

Re: exercise: partition a list by equivalence

2005-02-18 Thread John Machin
John Lenton wrote: > On Fri, Feb 18, 2005 at 03:21:10PM -0800, John Machin wrote: > > Not robust in the face of input like: > > [[1,1]] > > or > > [[1,2], [1,2]] > > or > > [[1,2], [2,1]] > > or > > [[1,2], [2,3], [3,1]] > > oops, my bad. > > > > > needs "if first == second: continue" here > > > >

Re: selecting dictionaries to maximize counts

2005-02-18 Thread Brian Beck
Steven Bethard wrote: > Anyway, do you know what name this problem is usually discussed under? If I knew what to google for, I could probably find at least a few simple heuristics to try... I think the closest thing would be the 'knapsack problem' or the 'subset sum problem.' http://en.wikipedi

Re: selecting dictionaries to maximize counts

2005-02-18 Thread Steven Bethard
Brian Beck wrote: Steven Bethard wrote: 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

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

2005-02-18 Thread Cyril BAZIN
Hello John, Try your python code on this example: merge([[1,2], [3,4], [1,2], [5,3]]) The result given by your function is: [[3, 4, 5]] Sorry... To Xah: next time you propose an exercise, write some UNIT TESTS!!! Then people will be able to test if there answers are correct or not. Cyril

Re: unicode encoding usablilty problem

2005-02-18 Thread aurora
On Fri, 18 Feb 2005 21:16:01 +0100, Martin v. Löwis <[EMAIL PROTECTED]> wrote: I'd like to point out the historical reason: Python predates Unicode, so the byte string type has many convenience operations that you would only expect of a character string. We have come up with a transition strateg

Re: exercise: partition a list by equivalence

2005-02-18 Thread John Lenton
On Fri, Feb 18, 2005 at 03:21:10PM -0800, John Machin wrote: > Not robust in the face of input like: > [[1,1]] > or > [[1,2], [1,2]] > or > [[1,2], [2,1]] > or > [[1,2], [2,3], [3,1]] oops, my bad. > > needs "if first == second: continue" here > > > if has_first and has_second: > >

Re: unicode encoding usablilty problem

2005-02-18 Thread aurora
On Fri, 18 Feb 2005 20:18:28 +0100, Walter Dörwald <[EMAIL PROTECTED]> wrote: 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, u

Re: selecting dictionaries to maximize counts

2005-02-18 Thread Brian Beck
Steven Bethard wrote: 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 ov

Re: unicode encoding usablilty problem

2005-02-18 Thread Neil Hodgson
Martin v. Löwis: > 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. Tried both -U and sys.setdefaultencoding("undefined") on a couple of my most used programs and saw a

Re: exercise: partition a list by equivalence

2005-02-18 Thread John Machin
John Lenton wrote: > 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 p

Re: selecting dictionaries to maximize counts

2005-02-18 Thread Steven Bethard
John Machin wrote: Steven Bethard wrote: I have a list of dictionaries. Each dictionary holds counts of various 'words'... ... Basically, I use a greedy approach -- adding a dict each time if I can. ... This leads to some suboptimal solutions given that, while the total counts must not exceed MAX

Graph

2005-02-18 Thread bearophileHUGS
This is the first version of the graph module I was developing... In the meantime I've seen that there are already lots of graph implementations, even a compiled one: ftp://xray.imsb.au.dk/pub/python/packages/Python2.1/RPMS/python-kjbuckets-2.2-7.i686.rpm (This makes my work less important, but it

Re: Unit Testing in Python

2005-02-18 Thread Lion Kimbro
No-nonsense PyUnit skeleton: http://www.python.org/moin/PyUnit Copy & Paste. Though there's a new module, [http://codespeak.net/py/current/doc/test.html py.test,] that's easier in many ways. -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpc.server.work() does not seem to handle multiple requests

2005-02-18 Thread pythonUser_07
Unfortunately no because this is a single threaded http server. It's great for testing stuff out, but it doesn't scale unless you make it scale. I am assuming you could use the Zope application server to scale your code. -- http://mail.python.org/mailman/listinfo/python-list

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-18 Thread A.B., Khalid
Ilias Lazaridis wrote: > The first step is to make a pyMinGW project. > You are mistaken. The first steps are the following: 1) Realizing that a project _must_ start not because you want it to, but because those who are willing to work on it think it is worth the extra effort for it to. 2) Reali

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-18 Thread JanC
Robert Kern schreef: > And yet there is not one company that has someone devoted full-time to > developing Python. Except for 'future Python' aka PyPy... :) -- JanC "Be strict when sending and tolerant when receiving." RFC 1958

Re: re.compile and very specific searches

2005-02-18 Thread rbt
John Machin wrote: 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 False re

Re: unicode and socket

2005-02-18 Thread Lion Kimbro
You probably want to use UTF-16 or UTF-8 on both sides of the socket. See http://www.python.org/moin/Unicode for more information. So, we have a Unicode string... >>> mystring=u'eggs and ham' >>> mystring u'eggs and ham' Now, we want to send it over: >>> to_send=mystring.encode('utf-8') >>> to_s

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-18 Thread Mike Meyer
Arich Chanachai <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>Whatever the intentions may be, the *act* is one of dictation. Since >>the point of the underlying OS is to increase the interconnections >>between applications (assuming I've found the correct web page and >>interpreted it correctl

Re: unicode and socket

2005-02-18 Thread Irmen de Jong
Irmen de Jong wrote: aurora wrote: 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 bot

Re: Font size

2005-02-18 Thread Adam
Thanks Fredrik, I got your program running (with a couple of tweaks) with just a quarter of an hour to spare before using it at our happy hour yesterday. The old ladies loved it. I can now adapt it for bingo. Thanking you Adam. -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and socket

2005-02-18 Thread Irmen de Jong
aurora wrote: 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. So use pickle

Re: Python, Matlab and AI question

2005-02-18 Thread Robert Kern
Alexander Schmolck wrote: Actually, I've written a highlevel matlab-python bridge (based on bugfixed and slightly extended version of the original pymat) which is quite up-to-date; by and large it makes using matlab from python as easy as if matlab were just some python library: Fantastic! I've add

Re: selecting dictionaries to maximize counts

2005-02-18 Thread John Machin
Steven Bethard wrote: > I have a list of dictionaries. Each dictionary holds counts of various > 'words', e.g.: > Basically, I use a greedy approach -- adding a dict each time if I can. > This leads to some suboptimal solutions given that, while the total > counts must not exceed MAX_VALUE, I

Re: re.compile and very specific searches

2005-02-18 Thread Diez B. Roggisch
> > This approach would actually work without the need for subsequent > validation, if implemented properly. Not only as you noted does it let > "259" through, but also it doesn't cover 2-digit numbers starting with > 2. Assuming excess leading zeroes are illegal, the components required > are: D

R*volume*raduis2 c3po "Theroy of everything"

2005-02-18 Thread zetasum
R*volume*raduis2 c3po "Theroy of everything" finding the multi-plex time and volume of the earth you can find the universe volume and time!! A.I =/2 You have to start all over agian with this t3echnology bulid A.I and a new quantium computer or supercomputer is the only way to get this to

Re: help for xml parsing error

2005-02-18 Thread Diez B. Roggisch
Michael Zhang wrote: > 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 You claim it is in xml format - but the parser error strongly suggest that it isn't. Please do show it to us, then

Re: re.compile and very specific searches

2005-02-18 Thread Diez B. Roggisch
> The OP wanted to "find" IP addresses -- unclear whether re.search or > re.match is required. Your solution doesn't address the search case. > For the match case, it needs some augmentation. It will fall apart if > presented with something like "..." or "comp.lang.python.announce". AND > while I'm

xmlrpc.server.work() does not seem to handle multiple requests

2005-02-18 Thread john14
Hi, I have an xmlrpc server. I using the python package xmlrpc. Here is what I am doing: s = xmlrpc.server() s.addMethods(method_hash) s.bindAndListen(PORT) while 1: try: s.work() except: e = sys.exc_info() The problem is that when I send m

Re: re.compile and very specific searches

2005-02-18 Thread John Machin
Diez B. Roggisch wrote: > > You could use another regular expressin, e.g. like this: > > > rex = re.compile(r"^((\d)|(1\d{1,2})|(2[0-5]\d))$") This approach would actually work without the need for subsequent validation, if implemented properly. Not only as you noted does it let "259" through, bu

Re: Help with research

2005-02-18 Thread elena
Thanks for input. You're right. Programmers would probably look for the abolute value of an answer. That's one reason why people sometimes get annoyed with us (I guess I'm thinking of the product managers I've worked with). In any case, this is an existing instrument and was not developed specifica

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:

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: 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: 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: 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 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

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

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

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

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 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

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: 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

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 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

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: - 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

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: 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: - 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: "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: 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

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: 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

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: 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

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: 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: "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: 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: 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: 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-

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.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

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: 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: 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 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 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: 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: 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 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: 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: 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

  1   2   >