Re: file locking...

2009-03-02 Thread Thomas Guettler
Hi Bruce, you can do it like Maildir [1] you move (os.rename()) file or directories. Maybe something like this: You have three directories: "todo", "in-process" and "done". A process tries to os.rename from todo to in-process. If it fails, some other process has done it before. If the process is

Re: how to find all completely connected sub-graphs?

2009-03-02 Thread Hyunchul Kim
Dear Odeits, Yes, I meant directly connected to each other. Thanks. Hyunchul odeits wrote: On Mar 2, 10:35 pm, Hyunchul Kim wrote: Hi, all, How can I find all "completely connected subgraphs" in a graph when node and edge data are available? "completely connected subgraph" is a group,

Re: how to find all completely connected sub-graphs?

2009-03-02 Thread odeits
On Mar 2, 10:35 pm, Hyunchul Kim wrote: > Hi, all, > > How can I find all "completely connected subgraphs" in a graph when node > and edge data are available? > > "completely connected subgraph" is a group, all members of which are > connected to each other. > > Thanks, > > Hyunchul Do you mean a

Re: Looking for a General Method to Configure Tkinter Widgets

2009-03-02 Thread odeits
On Mar 2, 7:14 am, "W. eWatson" wrote: > I'm modifying a Tkinter Python program that uses hard coded initial values > for several widgets. For example, latitude = 40. My plan is to put the names > and values for configuration purposes into a file. For example, a pseudo > statement like the one jus

how to find all completely connected sub-graphs?

2009-03-02 Thread Hyunchul Kim
Hi, all, How can I find all "completely connected subgraphs" in a graph when node and edge data are available? "completely connected subgraph" is a group, all members of which are connected to each other. Thanks, Hyunchul -- http://mail.python.org/mailman/listinfo/python-list

Re: RichCompare and RichCompareBool

2009-03-02 Thread Aaron Brady
On Mar 2, 9:24 pm, Terry Reedy wrote: > Gabriel Genellina wrote: > > En Mon, 02 Mar 2009 17:54:09 -0200, Terry Reedy > > escribió: > > >> Aaron Brady wrote: > >>> Hi, > >>>  In the source for 3.0.1, PyObject_RichCompareBool seems to perform an > >>> extra check on identity that PyObjecct_RichComp

Re: New User - Using tutorial and Docs - POST returns 302 Found

2009-03-02 Thread JohnV
Thanks for your suggestion, but I am not able to get it to work for me. My original script was: f = open('C:\Users\Owner\Desktop\mydata.txt', 'r') read_data = f.read() f.close() import httplib, urllib params = urllib.urlencode({'textarea1': read_data}) headers = {"Content-type": "application/x-

Re: yaml for persistence

2009-03-02 Thread Aaron Brady
On Mar 2, 8:19 pm, Paul wrote: > class User(object): >     def __init__(self, uid): >        self.uid = uid >        self.__dict__.update(yaml.load(str('uid')+'.yaml')) > >     def save(self): >         f=open(str(self.uid)+'.yaml') >         yaml.dump(self.__dict__, f) > > is there a better way t

Re: Upgrade Python on a Mac

2009-03-02 Thread Python Nutter
from my .profile file in ~ # This file does not get executed because .bash_profile exists in the home directory # and that gets executed instead. If .bash_profile did not exist then this file gets executed # PN hand edit export PATH to process the most recently installed Python Framework # otherw

Re: Characters aren't displayed correctly

2009-03-02 Thread Philip Semanchuk
On Mar 2, 2009, at 5:26 PM, John Machin wrote: On Mar 3, 3:27 am, Philip Semanchuk wrote: He claims to have done what I asked him to do in the first place -- break the problem into steps and verify the database steps. He says they're working OK. I chose to take him at his word. Rule number

Re: Shared library Python on Mac OS X 64-bit

2009-03-02 Thread Graham Dumpleton
On Mar 3, 12:25 pm, Uberman wrote: > I'm trying to build a 64-bit version of Python 2.5.1 on Mac OS X 10.5.6 64-bit > (Intel processor).  The configure line I'm using is: > > ./configure --enable-shared --disable-framework --disable-toolbox-glue > OPT="-fast -arch x86_64 -Wall -Wstrict-prototypes

Re: RichCompare and RichCompareBool

2009-03-02 Thread Terry Reedy
Gabriel Genellina wrote: En Mon, 02 Mar 2009 17:54:09 -0200, Terry Reedy escribió: Aaron Brady wrote: Hi, In the source for 3.0.1, PyObject_RichCompareBool seems to perform an extra check on identity that PyObjecct_RichCompare does not perform. To me, the existence of two functions sugges

google earth

2009-03-02 Thread azrael
did anyone ply with the google earth python api. this is totaly awsome. anyone got exampals? -- http://mail.python.org/mailman/listinfo/python-list

Re: RichCompare and RichCompareBool

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 17:54:09 -0200, Terry Reedy escribió: Aaron Brady wrote: Hi, In the source for 3.0.1, PyObject_RichCompareBool seems to perform an extra check on identity that PyObjecct_RichCompare does not perform. To me, the existence of two functions suggests that they are *intende

Re: py2exe automatic upgrades of a program while it is running, is that possible?

2009-03-02 Thread Maxim Khitrov
On Mon, Mar 2, 2009 at 9:18 PM, William Heath wrote: > Hi All, > I am using py2exe to create a windows executable.  I am curious if anyone > knows a way to automatically upgrade a py2exe windows executable while it is > running.  Is that possible?  If so how?  If it isn't possible, what is the > n

Re: Upgrade Python on a Mac

2009-03-02 Thread Rey Bango
Thank you Robert. Since I'm using a ~/.profile file instead of a ~/.bash_profile file, I guess the installer didn't update it. I just updated the path like you mentioned and now the new version of Python comes up. Rey... On Mar 2, 6:18 pm, Robert Kern wrote: > The installer should update your $

py2exe automatic upgrades of a program while it is running, is that possible?

2009-03-02 Thread William Heath
Hi All, I am using py2exe to create a windows executable. I am curious if anyone knows a way to automatically upgrade a py2exe windows executable while it is running. Is that possible? If so how? If it isn't possible, what is the next best thing? Also, if it is not available using py2exe is it

[ANN] EuroPython 2009 – Open for Regist ration and Reminder of Participation!

2009-03-02 Thread Martin P. Hellwig
On behalf of the EuroPython 2009 organisation it is my privilege and honour to announce that EuroPython 2009 is open for registration! EuroPython is the conference for the communities around Python, including the Django, Zope and Plone communities. This year's conference will be held in Birming

Re: New User - Using tutorial and Docs - POST returns 302 Found

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 23:02:10 -0200, JohnV escribió: I have to run the program one time just to get the dynamically generated redirect URL for the POST (it looks like this) The document has moved http://www.thenational.us/pages/htmlos/ 001863.1.059070780420726458"> I then paste the redirected U

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread Nick Mellor
Thanks Chris and John, all workin now. Sorry about proclamation of innocence-- fruitless morning and 3 hours sleep :-) Nick On Mar 3, 12:03 pm, Chris Rebert wrote: > On Mon, Mar 2, 2009 at 4:56 PM, Nick Mellor > > > > wrote: > > Hi all, > > > I'm pretty sure I'm following all the Python rules:

Shared library Python on Mac OS X 64-bit

2009-03-02 Thread Uberman
I'm trying to build a 64-bit version of Python 2.5.1 on Mac OS X 10.5.6 64-bit (Intel processor). The configure line I'm using is: ./configure --enable-shared --disable-framework --disable-toolbox-glue OPT="-fast -arch x86_64 -Wall -Wstrict-prototypes -fno-common -fPIC" LDFLAGS="-arch x86_64" Th

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread John Machin
On Mar 3, 11:56 am, Nick Mellor wrote: > Hi all, > > I'm pretty sure I'm following all the Python rules: I've put "self" > before "forename" to make sure it's treated as a data attribute > (instance variable.) And from within a class, I'm told, you need to > prefix the var with self too. RandomNam

Re: New User - Using tutorial and Docs - POST returns 302 Found

2009-03-02 Thread JohnV
I got it! You can see the code at the bottom of this post. Sorry for three posts on this question. I have to run the program one time just to get the dynamically generated redirect URL for the POST (it looks like this) The document has moved http://www.thenational.us/pages/htmlos/ 001863.1.05907

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread Chris Rebert
On Mon, Mar 2, 2009 at 4:56 PM, Nick Mellor wrote: > Hi all, > > I'm pretty sure I'm following all the Python rules: I've put "self" > before "forename" to make sure it's treated as a data attribute > (instance variable.) And from within a class, I'm told, you need to > prefix the var with self to

Attribute error-- but I'm innocent(?)

2009-03-02 Thread Nick Mellor
Hi all, I'm pretty sure I'm following all the Python rules: I've put "self" before "forename" to make sure it's treated as a data attribute (instance variable.) And from within a class, I'm told, you need to prefix the var with self too. RandomName is a class that I've tested (and which still work

Re: Python parser

2009-03-02 Thread andrew cooke
Clarendon wrote: [...] > I need to parse a large amount of texts collected from the web (around > a couple hundred sentences at a time) very quickly, so I need a parser > with a broad scope of grammar, enough to cover all these texts. This > is what I mean by 'random'. so the most important things

getting all HTTP headers from urllib2 Request?

2009-03-02 Thread cgoldberg
I have a Python web client that uses urllib2. It is easy enough to add my own HTTP headers to the outgoing requests. I just create a dictionary of the headers I want to add, and pass it to the Request initializer. These custom headers are not all that gets sent. urllib2 attaches headers also. Y

Re: ActivePython or Python from Python.org

2009-03-02 Thread Trent Mick
Rey Bango wrote: Hi everyone. I noticed that ActiveState has their own variation of Python and was curious if there's a benefit to choosing their version over the version offered via Python.org. Could someone lend some insight? Here is some reasoning I wrote a while back: http://mail.python.o

Re: HTTPError... read the response body?

2009-03-02 Thread Wojtek Walczak
On Mon, 2 Mar 2009 14:29:12 -0800 (PST), Stuart Davenport wrote: Hi, > I am trying to connect to a web service but I am getting HTTP 400, I > am not too concerned about the HTTP error - but what I'd like to know > if there is anyway I can read the response body in the HTTP 400 or 500 > case? Does

ActivePython or Python from Python.org

2009-03-02 Thread Rey Bango
Hi everyone. I noticed that ActiveState has their own variation of Python and was curious if there's a benefit to choosing their version over the version offered via Python.org. Could someone lend some insight? Thanks, Rey... -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrade Python on a Mac

2009-03-02 Thread Robert Kern
On 2009-03-02 17:06, Rey Bango wrote: Thank you Kevin (& all who replied). The next question (which I think will be my last until I've read more info) is: Once installed, how will I be able to distinguish between the OSX Apple-supplied, preinstalled version and the newly installed version that

Re: Upgrade Python on a Mac

2009-03-02 Thread Rey Bango
Thank you Kevin (& all who replied). The next question (which I think will be my last until I've read more info) is: Once installed, how will I be able to distinguish between the OSX Apple-supplied, preinstalled version and the newly installed version that I downloaded from Python.org? Currently,

Re: Python parser

2009-03-02 Thread Robert Kern
On 2009-03-02 16:14, Clarendon wrote: Thank you, Lie and Andrew for your help. I have studied NLTK quite closely but its parsers seem to be only for demo. It has a very limited grammar set, and even a parser that is supposed to be "large" does not have enough grammar to cover common words like "

Re: unziping a file in python..

2009-03-02 Thread David Lyon
On Mon, 02 Mar 2009 16:13:39 +, MRAB wrote: > zf = zipfile.ZipFile('Archive.zip') > for name in zf.namelist(): > new_path = os.path.join(output_folder, name) > data = zf.read(name) > try: > open(new_path, 'wb').write(data) > except IOError: > # Create i

HTTPError... read the response body?

2009-03-02 Thread Stuart Davenport
Hi There, I am trying to connect to a web service but I am getting HTTP 400, I am not too concerned about the HTTP error - but what I'd like to know if there is anyway I can read the response body in the HTTP 400 or 500 case? Does the HTTPError allow this? or the urllib2 in anyway? This is what I

Re: Characters aren't displayed correctly

2009-03-02 Thread John Machin
On Mar 3, 3:27 am, Philip Semanchuk wrote: > On Mar 2, 2009, at 10:50 AM, John Machin wrote: > > > On Mar 3, 2:22 am, Philip Semanchuk wrote: > >> See if you can successfully construct and send an email that says > >> "Hello world" in English/ASCII. If that works, change it to Arabic.   > >> If >

People working in AI using Python

2009-03-02 Thread tleeuwenb...@gmail.com
Hi all, I work on a natural language generation system for weather forecasting, using Python. I would like to find out if there is an active Python AI SIG or whether there is sufficient interest in forming one. Please email me offline (tleeuwenb...@gmail.com) if you're interested in touching base

Re: Upgrade Python on a Mac

2009-03-02 Thread MRAB
Rey Bango wrote: Hi, I'd like to upgrade the installed version of Python that came standard on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot in it, I just wanted to get a better understanding of the process. If I download the disk image installer from here: http://www.pytho

Re: New User - Using tutorial and Docs - POST returns 302 Found

2009-03-02 Thread JohnV
Here is what var data collected: 302 Found Found The document has moved http://www.thenational.us/pages/ htmlos/001863.1.059070780420726458">here. Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_mono/ 2.2 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1 Server at thenation

Re: Upgrade Python on a Mac

2009-03-02 Thread Kevin Walzer
Rey Bango wrote: Hi, I'd like to upgrade the installed version of Python that came standard on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot in it, I just wanted to get a better understanding of the process. If I download the disk image installer from here: http://www.pytho

Re: Upgrade Python on a Mac

2009-03-02 Thread Ned Deily
In article <50ca1bd0-b8d5-478c-aeaf-dd2b83187...@j38g2000yqa.googlegroups.com>, Rey Bango wrote: > I'd like to upgrade the installed version of Python that came standard > on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot > in it, I just wanted to get a better understanding of

Re: Upgrade Python on a Mac

2009-03-02 Thread Wes James
On Mon, Mar 2, 2009 at 2:53 PM, Rey Bango wrote: > Hi, > > I'd like to upgrade the installed version of Python that came standard > on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot > in it, I just wanted to get a better understanding of the process. I'd recommend you put your

Re: Python parser

2009-03-02 Thread Clarendon
Thank you, Lie and Andrew for your help. I have studied NLTK quite closely but its parsers seem to be only for demo. It has a very limited grammar set, and even a parser that is supposed to be "large" does not have enough grammar to cover common words like "I". I need to parse a large amount of t

Re: Python 2.6.1 urllib error on Mac os x PPC

2009-03-02 Thread Ned Deily
In article <20090302161256.120...@gmx.net>, "Attila Soki" wrote: > i trying to compile Python 2.6.1 on Mac OS X (ppc). > After configure/make/make install i test the compiled python with > the followig file (t.py) (example from > http://docs.python.org/library/urllib.html): > - > imp

Re: Performance of Python 3

2009-03-02 Thread andrew cooke
Isaac Gouy wrote: [...] > I think it would be silly to dispute whether or not programs that have > import psyco; psyco.bind are Python programs. > > I'm not sure it would be equally silly to dispute whether or not > programs with type declarations have moved away from being Python > programs. i do

Upgrade Python on a Mac

2009-03-02 Thread Rey Bango
Hi, I'd like to upgrade the installed version of Python that came standard on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot in it, I just wanted to get a better understanding of the process. If I download the disk image installer from here: http://www.python.org/download/ wil

RE: file locking...

2009-03-02 Thread Lawrence D'Oliveiro
In message , bruce wrote: > my concern about a "gatekeeper" wasn't so much related to performance, as > the possibility of race conditions... Which is what the gatekeeper will prevent. It serializes the granting of locks, and that means no race conditions. -- http://mail.python.org/mailman/li

Re: Performance of Python 3

2009-03-02 Thread Isaac Gouy
On Mar 2, 12:02 am, Stefan Behnel wrote: > Isaac Gouy wrote: > > On Mar 1, 11:24 am, Stefan Behnel wrote: > >> Isaac Gouy wrote: > >>> On Mar 1, 8:10 am, Stefan Behnel wrote: > As long as that gives you improvements of > 100-1000 times almost for free, I wouldn't bother too much with cha

Re: OT: handling multiple software repositories

2009-03-02 Thread Ferran . Jorba
We are happy users of DrProject 1.2 with SQLite and scgi. It works very well for our purposes, not exactly software development, but just for tracking our tasks and documentation, several projects, single login, different roles for each users, clean urls. The only trouble I have with it is that I

Re: How can I add space in to several numbers?

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 19:08:04 -0200, MRAB escribió: Gabriel Genellina wrote: En Mon, 02 Mar 2009 17:58:01 -0200, Bo Zhang escribió: I want to parse a file and do this : A 74.335 -86.474-129.317 1.00 54.12 then add space between -86.474 and -129.317. I can get the file with A

Re: How can I add space in to several numbers?

2009-03-02 Thread MRAB
Gabriel Genellina wrote: En Mon, 02 Mar 2009 17:58:01 -0200, Bo Zhang escribió: I want to parse a file and do this : A 74.335 -86.474-129.317 1.00 54.12 then add space between -86.474 and -129.317. I can get the file with A 74.335 -86.474 -129.317 1.00 54.12 Use a regular exp

New User - Using tutorial and Docs - POST returns 302 Found

2009-03-02 Thread JohnV
I am using Python 2.5 r25:51908 MSC v.1318 32 bit (Intel) on wind32 I am totally new to Python and started yesterday going over a couple of examples I found in the documentation which address a problem I am trying to solve. I have successfully opened a file and read the results adapting this code

Re: Email Program

2009-03-02 Thread Mike Driscoll
Hi James, On Mon, Mar 2, 2009 at 12:41 PM, James Matthews wrote: > You can look at Digsby for an example of an email program. I've followed Digsby for a while, but it's an instant messenger / social network aggregator, not an email client. It's much like a fancy Pidgin and it's not open source,

Re: Email Program

2009-03-02 Thread Tino Wildenhain
Hi, Dennis Lee Bieber wrote: On Sat, 28 Feb 2009 17:50:35 -0800 (PST), J declaimed the following in gmane.comp.python.general: Is it possible to make a GUI email program in Python that stores emails, composes, ect? What is "ect"? The latin phrase is "et cetera" -- roughly translated

Re: Email Program

2009-03-02 Thread James Matthews
There is always the issue of packaging at the end but Python is your programming language. On Mon, Mar 2, 2009 at 10:19 PM, Wayne Cannon wrote: > The Twisted package (http://twistedmatrix.com/) has some examples of > interacting with e-mail servers. Twisted supports interaction between > as

Re: Email Program

2009-03-02 Thread Wayne Cannon
The Twisted package (http://twistedmatrix.com/) has some examples of interacting with e-mail servers. Twisted supports interaction between asynchronous tasks. --Wayne J wrote: Is it possible to make a GUI email program in Python that stores emails, composes, ect? -- http://mail.python.org/m

Re: How can I add space in to several numbers?

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 17:58:01 -0200, Bo Zhang escribió: I want to parse a file and do this : A 74.335 -86.474-129.317 1.00 54.12 then add space between -86.474 and -129.317. I can get the file with A 74.335 -86.474 -129.317 1.00 54.12 Use a regular expression: py> import re p

Re: How can I add space in to several numbers?

2009-03-02 Thread Tim Chase
I want to parse a file and do this : A 74.335 -86.474-129.317 1.00 54.12 then add space between -86.474 and -129.317. I can get the file with A 74.335 -86.474 -129.317 1.00 54.12 How can I do this? Thanks. Is there something wrong with the following? for line in file('in.txt')

How can I add space in to several numbers?

2009-03-02 Thread Bo Zhang
I want to parse a file and do this : A 74.335 -86.474-129.317 1.00 54.12 then add space between -86.474 and -129.317. I can get the file with A 74.335 -86.474 -129.317 1.00 54.12 How can I do this? Thanks. -- Best regards, Zhang Bo (Cindy) SMA-CSB -- http://mail.python.org/mailman

Re: RichCompare and RichCompareBool

2009-03-02 Thread Terry Reedy
Aaron Brady wrote: Hi, In the source for 3.0.1, PyObject_RichCompareBool seems to perform an extra check on identity that PyObjecct_RichCompare does not perform. To me, the existence of two functions suggests that they are *intended* to act differently. Here's the excerpt from RichCompareBo

Re: Email Program

2009-03-02 Thread James Matthews
You can look at Digsby for an example of an email program. On Mon, Mar 2, 2009 at 8:34 PM, Mike Driscoll wrote: > On Feb 28, 7:56 pm, J wrote: > > Is it possible to make a GUI email program in Python that stores > > emails, composes, ect? Also, could I create my own programming > > language in

Re: Email Program

2009-03-02 Thread Mike Driscoll
On Feb 28, 7:56 pm, J wrote: > Is it possible to make a GUI email program in Python that stores > emails, composes, ect? Also, could I create my own programming > language in Python? What are Pythons limits, or is this just a waste > of my time to learn it. The book, "Programming Python 3rd ed."

Re: Performance of Python 3

2009-03-02 Thread Terry Reedy
Paul Boddie wrote: On 1 Mar, 15:20, Steve Holden wrote: Kless wrote: Does anybody has seen the performance of Python 3? Respect to speed it's the last language together to Ruby 1.8, but Ruby 1.9 has a lot of better performance. :( I'm not sure what you think the speed of Ruby has to do with P

Re: executable

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 13:24:20 -0200, toks teewey escribió: I want to ask if it is possible to link a program written in python to a database http://wiki.python.org/moin/DatabaseInterfaces and also on how to make a program written in python executable. http://wiki.python.org/moin/deploym

Re: Characters aren't displayed correctly

2009-03-02 Thread Philip Semanchuk
On Mar 2, 2009, at 10:50 AM, John Machin wrote: On Mar 3, 2:22 am, Philip Semanchuk wrote: See if you can successfully construct and send an email that says "Hello world" in English/ASCII. If that works, change it to Arabic. If that works, change the email format to HTML. If that works, st

Re: What's so wrong about execfile?

2009-03-02 Thread Carl Banks
On Mar 2, 8:43 am, John Nagle wrote: > Carl Banks wrote: > > On Feb 27, 7:21 pm, Sammo wrote: > >> Given that execfile has been removed in py3k, I want to understand > >> exactly why. > > >> Okay, I get that execfile is bad from the following thread: > > >> On Jul 29 2007, 2:39 pm, Steven D'Apran

Re: unziping a file in python..

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 13:09:05 -0200, Luis Zarrabeitia escribió: Quoting MRAB : Steven D'Aprano wrote: > You might want to specify an output folder (and the data might be binary too): zf = zipfile.ZipFile('Archive.zip') for name in zf.namelist(): open(os.path.join(output_folder, name), 'wb

Re: What's so wrong about execfile?

2009-03-02 Thread John Nagle
Carl Banks wrote: On Feb 27, 7:21 pm, Sammo wrote: Given that execfile has been removed in py3k, I want to understand exactly why. Okay, I get that execfile is bad from the following thread: On Jul 29 2007, 2:39 pm, Steven D'Aprano wrote: (1) Don't use eval, exec or execfile. (2) If you'

Re: unziping a file in python..

2009-03-02 Thread MRAB
Luis Zarrabeitia wrote: Quoting MRAB : Steven D'Aprano wrote: A quick and dirty solution would be something like this: zf = zipfile.ZipFile('Archive.zip') for name in zf.namelist(): open(name, 'w').write(zf.read(name)) You might want to specify an output folder (and the data might be bin

Python 2.6.1 urllib error on Mac os x PPC

2009-03-02 Thread Attila Soki
hi, i trying to compile Python 2.6.1 on Mac OS X (ppc). After configure/make/make install i test the compiled python with the followig file (t.py) (example from http://docs.python.org/library/urllib.html): - import urllib params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) f

Re: Iterator class to allow self-restarting generator expressions?

2009-03-02 Thread John O'Hagan
On Sun, 1 Mar 2009, Terry Reedy wrote: > John O'Hagan wrote: > > Inspired by some recent threads here about using classes to extend the > > behaviour of iterators, I'm trying to replace some some top-level > > functions aimed at doing such things with a class. > > > > So far it's got a test for emp

Re: Characters aren't displayed correctly

2009-03-02 Thread John Machin
On Mar 3, 2:22 am, Philip Semanchuk wrote: > On Mar 2, 2009, at 9:50 AM, Hussein B wrote: > > > On Mar 2, 4:31 pm, John Machin wrote: > >> On Mar 2, 7:30 pm, Hussein B wrote: > > >>> On Mar 1, 4:51 pm, Philip Semanchuk wrote: > What are you getting out of the database? Is it being converte

Re: Characters aren't displayed correctly

2009-03-02 Thread John Machin
On Mar 3, 1:50 am, Hussein B wrote: > On Mar 2, 4:31 pm, John Machin wrote:> On Mar 2, > 7:30 pm, Hussein B wrote: > > > > On Mar 1, 4:51 pm, Philip Semanchuk wrote: > > > > > On Mar 1, 2009, at 8:31 AM, Hussein B wrote: > > > > > > Hey, > > > > > I'm retrieving records from MySQL database tha

executable

2009-03-02 Thread toks teewey
Hello, I want to ask if it is possible to link a program written in python to a database and also on how to make a program written in python executable. Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Restructure dictionary (Python 2.5)

2009-03-02 Thread imageguy
> ... this is a crappy solution that's underusing Python. Please > enlighten me of a better way! > > - Fencer One thing that springs to mind is using the dict method .setdefault for dkey, vallist in old_dict.iteritems(): for val in vallist: new_dict.setdefault(val, set()).add(dkey)

Re: Characters aren't displayed correctly

2009-03-02 Thread Philip Semanchuk
On Mar 2, 2009, at 9:50 AM, Hussein B wrote: On Mar 2, 4:31 pm, John Machin wrote: On Mar 2, 7:30 pm, Hussein B wrote: On Mar 1, 4:51 pm, Philip Semanchuk wrote: What are you getting out of the database? Is it being converted to Unicode correctly, or at all? I don't know, how to make

Re: Multiple conditional expression

2009-03-02 Thread John Machin
On Feb 27, 7:55 pm, bearophileh...@lycos.com wrote: > Chris Rebert: > > > That seems to just be an overly complicated way of writing: > > > spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1) > > Better: > > spaces = bool(('spaces' in form) and form.getvalue('spaces') == 1) Huh?

Looking for a General Method to Configure Tkinter Widgets

2009-03-02 Thread W. eWatson
I'm modifying a Tkinter Python program that uses hard coded initial values for several widgets. For example, latitude = 40. My plan is to put the names and values for configuration purposes into a file. For example, a pseudo statement like the one just given. ConfigObj provides a mechanism for i

Re: Restructure dictionary (Python 2.5)

2009-03-02 Thread Tim Chase
I tried this code: old_dict = {'xyz':['a','b','c'],'baz':['c','d']} new_dict = {} for dkey, vallist in old_dict.iteritems(): for val in vallist: if val in new_dict: theset = new_dict[val] theset.add(dkey)

Re: unziping a file in python..

2009-03-02 Thread Luis Zarrabeitia
Quoting MRAB : > Steven D'Aprano wrote: > > A quick and dirty solution would be something like this: > > > > zf = zipfile.ZipFile('Archive.zip') > > for name in zf.namelist(): > > open(name, 'w').write(zf.read(name)) > > > You might want to specify an output folder (and the data might be bin

Re: socket problem

2009-03-02 Thread Jean-Paul Calderone
On Mon, 2 Mar 2009 06:40:57 -0800 (PST), step wrote: my server program is writed with c in windows using mingw,using "select" model client is writed with python the problem is , when the client connect the server, the function FD_ISSET(cilentfd,&set) always true, but it hvae read no data, i a

Restructure dictionary (Python 2.5)

2009-03-02 Thread Fencer
Hello, I have a dictionary that has strings as keys and for each key the associated value is a list of strings. Many of the lists contain only one element and a given element may appear for more than one key. What I need to do now is create a new dictionary where the strings in the list are keys

Re: Characters aren't displayed correctly

2009-03-02 Thread Hussein B
On Mar 2, 4:31 pm, John Machin wrote: > On Mar 2, 7:30 pm, Hussein B wrote: > > > On Mar 1, 4:51 pm, Philip Semanchuk wrote: > > > > On Mar 1, 2009, at 8:31 AM, Hussein B wrote: > > > > > Hey, > > > > I'm retrieving records from MySQL database that contains non english > > > > characters. > > Ca

socket problem

2009-03-02 Thread step
my server program is writed with c in windows using mingw,using "select" model client is writed with python the problem is , when the client connect the server, the function FD_ISSET(cilentfd,&set) always true, but it hvae read no data, i also no send data to server. why? i use telnet progr

Re: Characters aren't displayed correctly

2009-03-02 Thread John Machin
On Mar 2, 7:30 pm, Hussein B wrote: > On Mar 1, 4:51 pm, Philip Semanchuk wrote: > > > On Mar 1, 2009, at 8:31 AM, Hussein B wrote: > > > > Hey, > > > I'm retrieving records from MySQL database that contains non english > > > characters. Can you reveal which language??? > > > Then I create a St

Re: Python parser

2009-03-02 Thread andrew cooke
if this is for natural language texts you may want to look at http://www.nltk.org/ andrew Clarendon wrote: > Can somebody recommend a good parser that can be used in Python > programs? I need a parser with large grammar that can cover a large > amount of random texts. > > Thank you very much. >

Re: Characters aren't displayed correctly

2009-03-02 Thread Hussein B
On Mar 2, 4:03 pm, "J. Clifford Dyer" wrote: > On Mon, 2009-03-02 at 00:33 -0800, Hussein B wrote: > > On Mar 1, 11:27 pm, "J. Clifford Dyer" wrote: > > > On Sun, 2009-03-01 at 09:51 -0500, Philip Semanchuk wrote: > > > > On Mar 1, 2009, at 8:31 AM, Hussein B wrote: > > > > > > Hey, > > > > > I'm

Re: Characters aren't displayed correctly

2009-03-02 Thread J. Clifford Dyer
On Mon, 2009-03-02 at 00:33 -0800, Hussein B wrote: > On Mar 1, 11:27 pm, "J. Clifford Dyer" wrote: > > On Sun, 2009-03-01 at 09:51 -0500, Philip Semanchuk wrote: > > > On Mar 1, 2009, at 8:31 AM, Hussein B wrote: > > > > > > Hey, > > > > I'm retrieving records from MySQL database that contains no

Re: unziping a file in python..

2009-03-02 Thread MRAB
Steven D'Aprano wrote: On Mon, 02 Mar 2009 01:00:54 -0500, David Lyon wrote: It might seem a simple question.. but how does one programmaticaly unzip a file in python? A quick and dirty solution would be something like this: zf = zipfile.ZipFile('Archive.zip') for name in zf.namelist():

Re: Performance of Python 3

2009-03-02 Thread Paul Boddie
On 1 Mar, 15:20, Steve Holden wrote: > Kless wrote: > > Does anybody has seen the performance of Python 3? > > Respect to speed it's the last language together to Ruby 1.8, but Ruby > > 1.9 has a lot of better performance. :( > > I'm not sure what you think the speed of Ruby has to do with Python.

Re: Iterator class to allow self-restarting generator expressions?

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 06:48:02 -0200, Lie Ryan escribió: Gabriel Genellina wrote: En Sun, 01 Mar 2009 15:51:07 -0200, Chris Rebert escribió: On Sun, Mar 1, 2009 at 8:54 AM, Gabriel Genellina wrote: En Sun, 01 Mar 2009 13:20:28 -0200, John O'Hagan escribió: Inspired by some recent threads he

Re: RichCompare and RichCompareBool

2009-03-02 Thread Aaron Brady
On Mar 2, 5:00 am, Duncan Booth wrote: > Aaron Brady wrote: > > Hi, > > > In the source for 3.0.1, PyObject_RichCompareBool seems to perform an > > extra check on identity that PyObjecct_RichCompare does not perform. snip > > The code for PyObject_RichCompare does not contain this, it doesn't > >

Re: os module

2009-03-02 Thread Gabriel Genellina
En Mon, 02 Mar 2009 07:12:55 -0200, M Kumar escribió: Its just http, I am using pylons. Right now I am doing tht with extra parameter. But even if I get to know about the platform of the client machine, I need to use the other properties of the corresponding machine's os module. for example

Re: RichCompare and RichCompareBool

2009-03-02 Thread Duncan Booth
Aaron Brady wrote: > Hi, > > In the source for 3.0.1, PyObject_RichCompareBool seems to perform an > extra check on identity that PyObjecct_RichCompare does not perform. > > Here's the excerpt from RichCompareBool (line 612): > > /* Quick result when objects are the same. > Guaran

Re: OTish: convince the team to drop VBScript

2009-03-02 Thread jkn
On Feb 28, 8:19 pm, rdmur...@bitdance.com wrote: [...] > > IMO the first thing you ought to do is dig in, really listen, and find > out what his issue is with module distribution. > > Listening well is your most powerful asset. Overcome your own prejudices > first, and his may follow :) I agree w

RichCompare and RichCompareBool

2009-03-02 Thread Aaron Brady
Hi, In the source for 3.0.1, PyObject_RichCompareBool seems to perform an extra check on identity that PyObjecct_RichCompare does not perform. Here's the excerpt from RichCompareBool (line 612): /* Quick result when objects are the same. Guarantees that identity implies equali

Re: Python parser

2009-03-02 Thread Lie Ryan
Clarendon wrote: > Can somebody recommend a good parser that can be used in Python > programs? Do you want parser that can parse python source code or parser that works in python? If the latter, pyparsing is a popular choice. Ply is another. There are many choice: http://nedbatchelder.com/text/pyt

Python parser

2009-03-02 Thread Clarendon
Can somebody recommend a good parser that can be used in Python programs? I need a parser with large grammar that can cover a large amount of random texts. Thank you very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: os module

2009-03-02 Thread Tim Chase
Its just http, I am using pylons. Right now I am doing tht with extra parameter. But even if I get to know about the platform of the client machine, I need to use the other properties of the corresponding machine's os module. HTTP doesn't require the client browser to send any such information

Re: Performance of Python 3

2009-03-02 Thread Tim Rowe
2009/3/1 Paul Rubin : > Steve Holden writes: >> I'm not sure what you think the speed of Ruby has to do with Python. > > In the real world, people care about the relative speed of programs. Yes, and they care about the cost of programs, and about the functionality of programs. If I wanted fast co

  1   2   >