Re: Performance of Python 3

2009-03-02 Thread Stefan Behnel
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 changing the platform just because someone shows me

Re: imaplib fetch message flags

2009-03-02 Thread Lawrence D'Oliveiro
In message , Gabriel Genellina wrote: > RFC1730 defines IMAP4 and isn't > hard to read. This may also be worth reading. -- http://mail.python.org/mailman/listinfo/python-list

os module

2009-03-02 Thread M Kumar
Hi, I am writing a server side program, clients can be any machine but the server machine is Linux. In program I want to use the OS module based on the client's operating system. But when I do "import os" m only able to get the module with the property of Linux. ANy idea how to import the module w

Re: os module

2009-03-02 Thread Chris Rebert
On Mon, Mar 2, 2009 at 12:26 AM, M Kumar wrote: > > Hi, > > I am writing a server side program, clients can be any machine but the > server machine is Linux. In program I want to use the OS module based on the > client's operating system. But when I do "import os" m only able to get the > module w

Re: file locking...

2009-03-02 Thread Lawrence D'Oliveiro
In message , Nigel Rantor wrote: > In other words, why would you rely on a scheme that limits some > processes to certain parts of the data? That could be part of the original requirements, it's not clear from the description so far. -- http://mail.python.org/mailman/listinfo/python-list

RE: file locking...

2009-03-02 Thread Lawrence D'Oliveiro
In message , bruce wrote: > using any kind of file locking process requires that i essentially have a > gatekeeper, allowing a single process to enter, access the files at a > time... The gatekeeper doesn't need to do any more than ensure that any particular filename is only locked by a maximum

Re: Characters aren't displayed correctly

2009-03-02 Thread Hussein B
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. > > Then I create a String that contains HTML markup and column values > > from the previous result set. > >

Re: Characters aren't displayed correctly

2009-03-02 Thread Hussein B
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 non english > > > characters. > > > Then I create a String that co

Re: Email Program

2009-03-02 Thread Paul McGuire
On Mar 2, 1:11 am, Paul Rubin wrote: > Paul McGuire writes: > > As to your question of whether Python can be used to write an e-mail > > client, or to create a programming language, I assure you both are > > possible.  But also, given your unfamiliarity with Python,

Re: os module

2009-03-02 Thread M Kumar
Hi Chris, Thanks for quick and kind reply, but the python program runs on the server, sys.platform is linux only. What I want is I need to get a module, which shud be exactly same as if I import os module on the client machine On Mon, Mar 2, 2009 at 1:59 PM, Chris Rebert wrote: > On Mon, Mar 2,

Re: os module

2009-03-02 Thread Chris Rebert
> On Mon, Mar 2, 2009 at 1:59 PM, Chris Rebert wrote: >> >> On Mon, Mar 2, 2009 at 12:26 AM, M Kumar wrote: >> > >> > Hi, >> > >> > I am writing a server side program, clients can be any machine but the >> > server machine is Linux. In program I want to use the OS module based on >> > the >> > cl

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

2009-03-02 Thread Lie Ryan
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 here about using classes to exten

Re: Multiple conditional expression

2009-03-02 Thread Bruno Desthuilliers
Steve Holden a écrit : Anjanesh Lekshminarayanan wrote: How do we know that from the what the OP posted? Its CGI alright. spaces = form.has_key('spaces') and form.getvalue('spaces') == '1' But I just dont see how spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ? True: False : F

Re: os module

2009-03-02 Thread M Kumar
Oh that might be the problem, I m new to this and new to this kind of conversations. What you said was correct. But what I am looking for is, if one client reqst comes I need to process the data which I got from the client, so I need to use the os module. But since my program executes on the server

Re: os module

2009-03-02 Thread Chris Rebert
> On Mon, Mar 2, 2009 at 2:17 PM, Chris Rebert wrote: >> >> > On Mon, Mar 2, 2009 at 1:59 PM, Chris Rebert wrote: >> >> >> >> On Mon, Mar 2, 2009 at 12:26 AM, M Kumar wrote: >> >> > >> >> > Hi, >> >> > >> >> > I am writing a server side program, clients can be any machine but >> >> > the >> >> >

Re: os module

2009-03-02 Thread M Kumar
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 I need to use "os.path". So even if I know about the platform

Re: os module

2009-03-02 Thread Chris Rebert
> On Mon, Mar 2, 2009 at 2:31 PM, Chris Rebert wrote: >> > On Mon, Mar 2, 2009 at 2:17 PM, Chris Rebert wrote: >> >> > On Mon, Mar 2, 2009 at 1:59 PM, Chris Rebert >> >> > wrote: >> >> >> On Mon, Mar 2, 2009 at 12:26 AM, M Kumar >> >> >> wrote: >> >> >> > >> >> >> > Hi, >> >> >> > >> >> >> > I

Re: Multiple conditional expression

2009-03-02 Thread Christian Tismer
On 3/2/09 12:53 AM, Bruno Desthuilliers wrote: Steve Holden a écrit : Anjanesh Lekshminarayanan wrote: How do we know that from the what the OP posted? Its CGI alright. spaces = form.has_key('spaces') and form.getvalue('spaces') == '1' But I just dont see how spaces = (form.has_key('spaces')

Re: ordinal not in range

2009-03-02 Thread Jaap van Wingerde
Stefan Behnel wrote: >> Jaap van Wingerde wrote: >> outfile = codecs.open(output, "w", "utf_8") > I guess you mixed up the case here. > Does this help? > outfile = codecs.open(output, "wb", encoding="UTF-8") According to the Python "Codec registry an base classes"

Re: How best to test functions which use date.today

2009-03-02 Thread Yuan HOng
Hello, Thanks for all the great ideas. Based on your input, I was able to solve my problem by way of a FakeDate in a fakedate module. In the testing module, before importing the tested module, I would load my fakedate module into sys.modules under the key 'datetime'. So when the tested module is

RE: file locking...

2009-03-02 Thread bruce
hi lawrence.. my concern about a "gatekeeper" wasn't so much related to performance, as the possibility of race conditions... if you only have a few client apps trying to access the files in the target dir, than you can in theory probably be ok.. for my app, the client process seeking files in th

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >