[RELEASED] Python 3.1 final

2009-06-27 Thread Benjamin Peterson
On behalf of the Python development team, I'm thrilled to announce the first production release of Python 3.1. Python 3.1 focuses on the stabilization and optimization of the features and changes that Python 3.0 introduced. For example, the new I/O system has been rewritten in C for speed. File

Re: Replacing a built-in method of a module object instance

2009-06-27 Thread Peter Otten
David Hirschfield wrote: I have a need to replace one of the built-in methods of an arbitrary instance of a module in some python code I'm writing. Specifically, I want to replace the __getattribute__() method of the module I'm handed with my own __getattribute__() method which will do

Re: No trees in the stdlib?

2009-06-27 Thread Stefan Behnel
João Valverde wrote: I wouldn't consider anything other than C for such a module on efficiency alone, unless it was a prototype of course. But I have little knowledge about the Python C API. Cython is your true friend, if only for rapid prototyping. http://cython.org/ Stefan --

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-27 Thread Stefan Behnel
Kee Nethery wrote: On Jun 25, 2009, at 11:39 PM, Stefan Behnel wrote: parsing a document from a string does not have its own function, because it is trivial to write tree = parse(BytesIO(some_byte_string)) :-) Trivial for someone familiar with the language. For a newbie like me, that

Re: Python simple web development

2009-06-27 Thread laplacia...@gmail.com
On Jun 26, 6:08 pm, Thomas Allen thomasmal...@gmail.com wrote: On Jun 25, 3:29 am, Private Private mail...@gmail.com wrote: Can you suggest anything ? I don't think anything's lighter than web.py. http://webpy.org/ My impression is that webpy is intended for experienced users who might

Re: It's ...

2009-06-27 Thread Gabriel Genellina
En Thu, 25 Jun 2009 14:07:19 -0300, Angus Rodgers twir...@bigfoot.com escribió: On Thu, 25 Jun 2009 17:56:47 +0100, I burbled incoherently: [...] does the new feature, by which a file becomes iterable, operate by some kind of coercion of a file object to a list object, via something like

Re: looking for a book on python

2009-06-27 Thread laplacia...@gmail.com
On Jun 26, 8:48 pm, Randy Foiles ab...@127.0.0.1 wrote: Hello and thank you for taking your time to read this.         I was interested in learning about python.  In the long ago past I did learn some programing but I have not used any of it for years.  I do remember some basics however so the

Re: No trees in the stdlib?

2009-06-27 Thread João Valverde
João Valverde wrote: Aahz wrote: In article mailman.2170.1246042676.8015.python-l...@python.org, =?ISO-8859-1?Q?Jo=E3o_Valverde?= backu...@netcabo.pt wrote: Anyway, I'm *not* trying to discourage you, just explain some of the roadblocks to acceptance that likely are why it hasn't already

Re: Python simple web development

2009-06-27 Thread laplacia...@gmail.com
On Jun 27, 2:25 am, laplacia...@gmail.com laplacia...@gmail.com wrote: As Thomas suggests, maybe have a look at Werkzeug ... Typo: s/Thomas/Petr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: os.walk and os.listdir problems python 3.0+

2009-06-27 Thread Gabriel Genellina
En Thu, 25 Jun 2009 11:15:15 -0300, Amos Anderson amosander...@gmail.com escribió: Thank you. That works very well when writing to a text file but what is the equivalent when writing the information to stdout using print? See this recent post:

Regular Expression Non Capturing Grouping Does Not Work.

2009-06-27 Thread Virtual Buddha
Hello all, I am having some difficulties with the non-capturing grouping in python regular expression module. Even the code from the online documentation (http://docs.python.org/ howto/regex.html#non-capturing-and-named-groups) does not seem to work. As per the docs given in the link above this

Re: Regular Expression Non Capturing Grouping Does Not Work.

2009-06-27 Thread Miles Kaufmann
On Jun 27, 2009, at 3:28 AM, Virtual Buddha wrote: Hello all, I am having some difficulties with the non-capturing grouping in python regular expression module. Even the code from the online documentation (http://docs.python.org/ howto/regex.html#non-capturing-and-named-groups) does not seem

Re: Regular Expression Non Capturing Grouping Does Not Work.

2009-06-27 Thread Peter Otten
Virtual Buddha wrote: Hello all, I am having some difficulties with the non-capturing grouping in python regular expression module. Even the code from the online documentation (http://docs.python.org/ howto/regex.html#non-capturing-and-named-groups) does not seem to work. As per the

Re: Beginning with Python; the right choice?

2009-06-27 Thread Terry Reedy
Chris Rebert wrote: On Fri, Jun 26, 2009 at 10:39 PM, Terry Reedytjre...@udel.edu wrote: sato.ph...@gmail.com wrote: Hi, As you can imagine, I am new, both to this group and to Python. I have read various posts on the best book to buy or online tutorial to read and have started to go through

Re: Beginning with Python; the right choice?

2009-06-27 Thread Hendrik van Rooyen
Terry Reedy tjre...@...l.edu wrote: I consider Python the Basic of the 21st century. Oh Dear. Was it not Dijkstra who said that learning basic rotted your brain, or words more or less to that effect? And here I am, feeling rather dull lately... :-) To the OP: - Learning Python

Re: looking for a book on python

2009-06-27 Thread OdarR
On 27 juin, 02:48, Randy Foiles ab...@127.0.0.1 wrote: Hello and thank you for taking your time to read this.         I was interested in learning about python.  In the long ago past I did learn some programing but I have not used any of it for years.  I do remember some basics however so the

Re: Regular Expression Non Capturing Grouping Does Not Work.

2009-06-27 Thread Virtual Buddha
group != groups match.group() or match.group(0) gives you a special group that comprises the whole match. Regular capturing groups start at index 1, and only those are returned by match.groups(): re.match((?:[abc])+, abc).group() # one group 'abc' re.match((?:[abc])+, abc).groups() #

Re: YASS (Yet Another Success Story)

2009-06-27 Thread Gabriel Genellina
En Sat, 20 Jun 2009 07:58:02 -0300, k3xji sum...@gmail.com escribió: Started a project year ago with hard goals in mind : Developing a game server which can handle thousands of clients simultaneously. [...] I don't know Python at the time and only coded few simple projects with it. And you

Re: Beginning with Python; the right choice?

2009-06-27 Thread OdarR
On 27 juin, 04:22, sato.ph...@gmail.com sato.ph...@gmail.com wrote: Hi, As you can imagine, I am new, both to this group and to Python.  I have read various posts on the best book to buy or online tutorial to read and have started to go through them.  I was wondering, as someone with

Re: Beginning with Python; the right choice?

2009-06-27 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! Che M wrote: In terms of good tutorials for absolute beginners, here are two: Alan Gauld's Learning to Program http://www.freenetpages.co.uk/hp/alan.gauld/ ... Also, don't miss the great Dive into Python: http://diveintopython.org/ A

Re: It's ...

2009-06-27 Thread Angus Rodgers
On Sat, 27 Jun 2009 03:32:12 -0300, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Iterators were added in Python 2.2. Just my luck. :-) See PEP 234 http://www.python.org/dev/peps/pep-0234/ You've got to love a language whose documentation contains sentences beginning like this: Among its

Re: The system cannot execute the specified program.

2009-06-27 Thread Lawrence D'Oliveiro
In message 1co94553odu2d0dfnn89fdkgbsvo5dv...@4ax.com, Tim Slattery wrote: When I googled that message, the links that came up had to do with missing DLLs. Ironic, isn't it, that Microsoft designs these messages to be non-technical to avoid putting off ordinary users, and yet it just ends up

Fast Dictionary Access

2009-06-27 Thread Thomas Lehmann
Hi! In C++, programming STL you will use the insert method which always provides a position and a flag which indicates whether the position results from a new insertion or an exisiting element. Idea is to have one search only. code if data.has_key(key): value = data[key] /code But this does

Re: Fast Dictionary Access

2009-06-27 Thread Chris Rebert
On Sat, Jun 27, 2009 at 2:47 AM, Thomas Lehmanniris-und-thomas-lehm...@t-online.de wrote: Hi! In C++, programming STL you will use the insert method which always provides a position and a flag which indicates whether the position results from a new insertion or an exisiting element. Idea is

Python Imaging Library download link broken?

2009-06-27 Thread peter
Just got a new computer and I'm trying to download my favourite applications. All's well until I get to PIL, and here pythonware and effbot both return a 502 Proxy error. Is this just a temporary glitch, or something more serious? And if it's the latter, is there any alternative source? Peter

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
In article 0244e76b$0$20638$c3e8...@news.astraweb.com, Steven D'Aprano st...@removethis.cybersource.com.au wrote: Nathan Stoddard wrote: The best way to become a good programmer is to program. Write a lot of code; work on some large projects. This will improve your skill more than anything

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
In article 0050ecf7$0$9684$c3e8...@news.astraweb.com, Steven D'Aprano st...@removethis.cybersource.com.au wrote: SNIP On 2009-06-14 14:04:02 +0100, Steven D'Aprano st...@removethis.cybersource.com.au said: I think I'm paraphrasing Richard Feynman here, but the only way to truly understand

Re: Beginning with Python; the right choice?

2009-06-27 Thread sato.ph...@gmail.com
Thank you for all of the links and advice. What do I want to learn Python for? Again, pardon me for my lack of relevant information. I am also a journalist (an out of work one at the moment, like so many others) and I feel that learning python could be useful for computer assisted reporting,

Re: Fast Dictionary Access

2009-06-27 Thread Paul Rubin
Thomas Lehmann iris-und-thomas-lehm...@t-online.de writes: code if data.has_key(key): value = data[key] /code But this does mean (does it?) that the dictionary is searched two times! If so, can somebody show me how to do this in one step? value = data.get(key, None) sets value to

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
In article 7xocssvzrh@ruckus.brouhaha.com, Paul Rubin http://phr...@nospam.invalid wrote: koranthala koranth...@gmail.com writes: Which are the classic books in computer science which one should peruse? I have (a) Code Complete (b) GOF (c) Art of programming. Art of

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Fri, 26 Jun 2009 18:58:27 -0700 (PDT), powah wong_po...@yahoo.ca wrote: On Jun 26, 4:51 pm, Chris Rebert c...@rebertia.com wrote: On Fri, Jun 26, 2009 at 12:43 PM, powahwong_po...@yahoo.ca wrote: How to change the first character of the line to uppercase in a text file? [...] We're

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Fri, 26 Jun 2009 18:58:27 -0700 (PDT), powah wong_po...@yahoo.ca wrote: Thank you for your hint. This is my solution: f = open('test', 'r') for line in f: print line[0].upper()+line[1:], Will your program handle empty lines of input correctly? -- Angus Rodgers --

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Sat, 27 Jun 2009 11:39:28 +0100, I asked rhetorically: On Fri, 26 Jun 2009 18:58:27 -0700 (PDT), powah wong_po...@yahoo.ca wrote: Thank you for your hint. This is my solution: f = open('test', 'r') for line in f: print line[0].upper()+line[1:], Will your program handle empty lines of

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Peter Otten
Angus Rodgers wrote: On Sat, 27 Jun 2009 11:39:28 +0100, I asked rhetorically: On Fri, 26 Jun 2009 18:58:27 -0700 (PDT), powah wong_po...@yahoo.ca wrote: Thank you for your hint. This is my solution: f = open('test', 'r') for line in f: print line[0].upper()+line[1:], Will your program

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Sat, 27 Jun 2009 13:02:47 +0200, Peter Otten __pete...@web.de wrote: Angus Rodgers wrote: On Sat, 27 Jun 2009 11:39:28 +0100, I asked rhetorically: Will your program handle empty lines of input correctly? Strangely enough, it seems to do so, but why? Because there aren't any. When you

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Sat, 27 Jun 2009 12:13:57 +0100, I wrote: the \r\n sequence at the end of a Win/DOS file Of course, I meant the end of a line of text, not the end of the file. (I promise I'll try to learn to proofread my posts. This is getting embarrassing!) -- Angus Rodgers --

to use unicode strings only

2009-06-27 Thread Gaudha
Hey gentlemen, I wanna make all the strings in my code unicode strings. How to do it without giving unicode switch 'u' before every string? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary self lookup

2009-06-27 Thread Jure Erznožnik
Norberto, While certainly useful, this kind of functionality contradicts the way today's string libraries work. What you are proposing isn't dict self referencing, but rather strings referencing other external data (in this case other strings from the same dict). When you write code like config

Re: Fast Dictionary Access

2009-06-27 Thread Duncan Booth
Thomas Lehmann iris-und-thomas-lehm...@t-online.de wrote: Hi! In C++, programming STL you will use the insert method which always provides a position and a flag which indicates whether the position results from a new insertion or an exisiting element. Idea is to have one search only.

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Sat, 27 Jun 2009 12:13:57 +0100, I wrote: Hmm ... the \r\n sequence at the end of a Win/DOS file seems to be treated as a single character. For instance, if test001A.txt is this file: abc xyz Bd ef gH ij and test001E.py is this: f = open('test001A.txt', 'r') for line in f: print

Re: to use unicode strings only

2009-06-27 Thread MRAB
Gaudha wrote: Hey gentlemen, I wanna make all the strings in my code unicode strings. How to do it without giving unicode switch 'u' before every string? Use Python 3.1 instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Peter Otten
Angus Rodgers wrote: On Sat, 27 Jun 2009 13:02:47 +0200, Peter Otten __pete...@web.de wrote: Angus Rodgers wrote: On Sat, 27 Jun 2009 11:39:28 +0100, I asked rhetorically: Will your program handle empty lines of input correctly? Strangely enough, it seems to do so, but why? Because

Re: Python Imaging Library download link broken?

2009-06-27 Thread olivergeorge
Ditto. Anyone know what's happening with pythonware? (and why PIL is such a pain to install for that matter.) -- http://mail.python.org/mailman/listinfo/python-list

Re: to use unicode strings only

2009-06-27 Thread Peter Otten
MRAB wrote: Gaudha wrote: I wanna make all the strings in my code unicode strings. How to do it without giving unicode switch 'u' before every string? Use Python 3.1 instead. or use from __future__ import unicode_literals in Python 2.6. --

Re: Beginning with Python; the right choice?

2009-06-27 Thread Thomas Lehmann
read and have started to go through them.  I was wondering, as someone with virtually no programming experience (I am a photographer by trade), is Python the right language for me to try and learn? Well, I'm a 100% C++ programmer but I like programming python for prototyping and tools. The

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Angus Rodgers
On Sat, 27 Jun 2009 13:49:57 +0200, Peter Otten __pete...@web.de wrote: Angus Rodgers wrote: On Sat, 27 Jun 2009 13:02:47 +0200, Peter Otten __pete...@web.de wrote: Angus Rodgers wrote: On Sat, 27 Jun 2009 11:39:28 +0100, I asked rhetorically: Will your program handle empty lines of

Animate 3D Surface

2009-06-27 Thread Philip Gröger
Hi, is there a way to animate a 3D surface in python using matplotlib 0.98 / mayavi 3 (i have the python(xy) suite for windows) or vpython? In *vpython* I tried to adjust the included faces_heightfield.py demo. But didnt find a way to delete the old surface. I just add more... In *matplotlib* I

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Peter Otten
Angus Rodgers wrote: Yes, I understood that, and it's logical, but what was worrying me was how to understand the cross-platform behaviour of Python with regard to the different representation of text files in Windows and Unix-like OSs. (I remember getting all in a tizzy about this If you

Re: postgreSQL python bindings - which one?

2009-06-27 Thread Albert Hopkins
On Fri, 2009-06-26 at 21:10 -0700, Horace Blegg wrote: Hi, I'm having a hard time deciding which set of PGSQL python bindings to go with. I don't know much about SQL to begin with, so the collage of packages of somewhat daunting. I'm starting a pet project in order to teach my self more, but I

csv blank fields

2009-06-27 Thread Mag Gam
I am using the csv package to parse a compressed .csv.gz file. So far its working perfectly fine but it fails when I have a missing value in on of the fields. For example, I have this Abc,def,,jkl Is it possible to fill the missing column with a null? I want, Abc,def,NULL,jkl TIA --

Re: Good books in computer science?

2009-06-27 Thread Paul Rubin
Albert van der Horst alb...@spenarnc.xs4all.nl writes: Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Thanks. I lost that title a while ago, must buy. Wait a few months, a third edition is in the works. Also Numerical Recipe's in

Re: csv blank fields

2009-06-27 Thread MRAB
Mag Gam wrote: I am using the csv package to parse a compressed .csv.gz file. So far its working perfectly fine but it fails when I have a missing value in on of the fields. For example, I have this Abc,def,,jkl Is it possible to fill the missing column with a null? I want, Abc,def,NULL,jkl

Re: csv blank fields

2009-06-27 Thread Mag Gam
well, I am actually loading the row into a fixed width array reader=csv.reader(fs) for s,row in enumerate(reader): t=np.array([(row[0],row[1],row[2],row[3],row[4],row[5],row[6],row[7],row[8],row[9],row[10])],dtype=mtype) d[s]=t If there is a missing field, I get a problem in one of my rows

Re: to use unicode strings only

2009-06-27 Thread Benjamin Peterson
Gaudha sanal.vikram at gmail.com writes: Hey gentlemen, I wanna make all the strings in my code unicode strings. How to do it without giving unicode switch 'u' before every string? Or the -U flag, but that's probably a bad idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: csv blank fields

2009-06-27 Thread Peter Otten
Mag Gam wrote: well, I am actually loading the row into a fixed width array reader=csv.reader(fs) for s,row in enumerate(reader): t=np.array([(row[0],row[1],row[2],row[3],row[4],row[5],row[6],row[7],row[8],row[9],row[10])],dtype=mtype) d[s]=t If there is a missing field, I get a

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread D'Arcy J.M. Cain
On Sat, 27 Jun 2009 11:54:43 +0100 Angus Rodgers twir...@bigfoot.com wrote: On Sat, 27 Jun 2009 11:39:28 +0100, I asked rhetorically: f = open('test', 'r') for line in f: print line[0].upper()+line[1:], Will your program handle empty lines of input correctly? Strangely enough, it

Re: Beginning with Python; the right choice?

2009-06-27 Thread 疯图灵
On 6月27日, 上午10时22分, sato.ph...@gmail.com sato.ph...@gmail.com wrote: Hi, As you can imagine, I am new, both to this group and to Python. I have read various posts on the best book to buy or online tutorial to read and have started to go through them. I was wondering, as someone with

Re: file transfer in python

2009-06-27 Thread vasudevram
On Jun 26, 5:07 pm, Francesco Bochicchio bieff...@gmail.com wrote: On 26 Giu, 13:38, jayesh bhardwaj bhardwajjay...@gmail.com wrote: i am trying to find something useful in python to transfer html files from one terminal to other. Can this be done with some module or shall i start coding

Re: csv blank fields

2009-06-27 Thread jkv
Mag Gam wrote: well, I am actually loading the row into a fixed width array reader=csv.reader(fs) for s,row in enumerate(reader): t=np.array([(row[0],row[1],row[2],row[3],row[4],row[5],row[6],row[7],row[8],row[9],row[10])],dtype=mtype) d[s]=t If there is a missing field,

Re: to use unicode strings only

2009-06-27 Thread Gaudha
On Jun 27, 4:54 pm, Peter Otten __pete...@web.de wrote: MRAB wrote: Gaudha wrote: I wanna make all the strings in my code unicode strings. How to do it without giving unicode switch 'u' before every string? Use Python 3.1 instead. or use from __future__ import unicode_literals in

Buffer pair for lexical analysis of raw binary data

2009-06-27 Thread Angus Rodgers
Partly as an educational exercise, and partly for its practical benefit, I'm trying to pick up a programming project from where I left off in 2001. It implemented in slightly generalised form the buffer pair scheme for lexical analysis described on pp. 88--92 of Aho et al., /Compilers:

Re: csv blank fields

2009-06-27 Thread Mag Gam
Peter: Sorry if I wasn't clear before. While reading my csv file, notice I am putting the content in an array. If lets say, row[5] has nothing in it, python gives an exception. Instead of the exception, I would like to assign 'NULL' to row[5]. Does that help? On Sat, Jun 27, 2009 at 10:03

Re: to use unicode strings only

2009-06-27 Thread Benjamin Peterson
Gaudha sanal.vikram at gmail.com writes: And Peter, I tried importing the __future__ module. It's also not working... How so? -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast Dictionary Access

2009-06-27 Thread Rachel P
[Thomas Lehmann] In C++, programming STL you will use the insert method which always provides a position and a flag which indicates whether the position results from a new insertion or an exisiting element. Idea is to have one search only. code if  data.has_key(key):    value = data[key]

Re: Beginning with Python; the right choice?

2009-06-27 Thread Charles Yeomans
On Jun 26, 2009, at 10:22 PM, sato.ph...@gmail.com wrote: Hi, As you can imagine, I am new, both to this group and to Python. I have read various posts on the best book to buy or online tutorial to read and have started to go through them. I was wondering, as someone with virtually no

What does Guido want in a GUI toolkit for Python?

2009-06-27 Thread laplacia...@gmail.com
I just read a blog post of Guido's http://neopythonic.blogspot.com/2009/06/ironpython-in-action-and-decline-of.html and notice that he doesn't comment on what he wants in a GUI toolkit for Python. I sorta' wish he'd just come out and say, This is what I think would be suitable for a GUI toolkit

Re: csv blank fields

2009-06-27 Thread MRAB
Mag Gam wrote: Peter: Sorry if I wasn't clear before. While reading my csv file, notice I am putting the content in an array. If lets say, row[5] has nothing in it, python gives an exception. Instead of the exception, I would like to assign 'NULL' to row[5]. Does that help? You still

encoding problem

2009-06-27 Thread netpork
Hello, I have ssl socket with server and client, on my development machine everything works pretty well. Database which I have to use is mssql on ms server 2003, so I decided to install the same python config there and run my python server script. Now here is the problem, server is returning

Re: What does Guido want in a GUI toolkit for Python?

2009-06-27 Thread Casey Hawthorne
So, what *does* Guido want in a GUI toolkit for Python? I saw a talk by a school teacher on pyFLTK: GUI programming made easy. On another note: I#: Groovy makes it easy to tie into the Java Swing GUI, so if Python could do that, with the added complication being the user would need a JVM. --

Re: csv blank fields

2009-06-27 Thread Peter Otten
Mag Gam wrote: Please don't top-post. Sorry if I wasn't clear before. While reading my csv file, notice I am putting the content in an array. That's already in the code you posted. What's missing is the value of mtypes. I really meant it when I asked you to provide a self-contained

Re: postgreSQL python bindings - which one?

2009-06-27 Thread Philip Semanchuk
On Jun 27, 2009, at 8:27 AM, Albert Hopkins wrote: On Fri, 2009-06-26 at 21:10 -0700, Horace Blegg wrote: Hi, I'm having a hard time deciding which set of PGSQL python bindings to go with. I don't know much about SQL to begin with, so the collage of packages of somewhat daunting. I'm

Looking for developer to help me

2009-06-27 Thread Daniel Gerzo
Hello guys, I have started to work on a new python library (called PySubLib), which is intended to allow applications to work with subtitles (the most common formats) easily. As I am pretty new to Python programming, I would appreciate if somebody with some spare time and Python foo could

Re: Beginning with Python; the right choice?

2009-06-27 Thread Kee Nethery
I'll give you the same advice I used to give to people when they wanted to decide whether to get a Mac or a PC, go with what your local group of friends is using. In general, if you have a local friend who can come over weekly (or you can visit weekly) and have them help you with the

Re: Good books in computer science?

2009-06-27 Thread Terry Reedy
A Steven D'Aprano st...@removethis.cybersource.com.au wrote: SNIP On 2009-06-14 14:04:02 +0100, Steven D'Aprano st...@removethis.cybersource.com.au said: I think I'm paraphrasing Richard Feynman here, but the only way to truly understand something is to do it. An amazingly inappropriate quote

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Terry Reedy
Peter Otten wrote: Will your program handle empty lines of input correctly? Strangely enough, it seems to do so, but why? Because there aren't any. When you read lines from a file there will always be at least the newline character. Otherwise it would indeed fail: Except possibly for the

Re: looking for a book on python

2009-06-27 Thread Kee Nethery
I'm a newbie and I need examples and I find that Python for Dummies is my best paper source for examples. Kee Nethery -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2009-06-27 Thread Piet van Oostrum
netpork todorovic.de...@gmail.com (n) wrote: n Hello, n I have ssl socket with server and client, on my development machine n everything works pretty well. n Database which I have to use is mssql on ms server 2003, so I decided n to install the same python config there and run my python server n

Re: What does Guido want in a GUI toolkit for Python?

2009-06-27 Thread Terry Reedy
laplacia...@gmail.com wrote: I just read a blog post of Guido's http://neopythonic.blogspot.com/2009/06/ironpython-in-action-and-decline-of.html and notice that he doesn't comment on what he wants in a GUI toolkit for Python. I sorta' wish he'd just come out and say, This is what I think would

Re: looking for a book on python

2009-06-27 Thread Aahz
In article mailman.2224.1246124498.8015.python-l...@python.org, Kee Nethery k...@kagi.com wrote: I'm a newbie and I need examples and I find that Python for Dummies is my best paper source for examples. Thank you! That's one thing we worked hard on. -- Aahz (a...@pythoncraft.com)

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Piet van Oostrum
Terry Reedy tjre...@udel.edu (TR) wrote: TR Peter Otten wrote: Will your program handle empty lines of input correctly? Strangely enough, it seems to do so, but why? Because there aren't any. When you read lines from a file there will always be at least the newline character. Otherwise it

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Peter Otten
Terry Reedy wrote: Peter Otten wrote: Will your program handle empty lines of input correctly? Strangely enough, it seems to do so, but why? Because there aren't any. When you read lines from a file there will always be at least the newline character. Otherwise it would indeed fail:

Re: Python simple web development

2009-06-27 Thread Kee Nethery
Until I'm an experience Python coder, I'm sticking with built-in packages only. My simple CGI is: #!/usr/bin/env python # this simple CGI responds to a GET or a POST # send anything you want to this and it will parrot it back. # a line that starts with #2 is the old-style code you should

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Emile van Sebille
On 6/27/2009 3:39 AM Angus Rodgers said... On Fri, 26 Jun 2009 18:58:27 -0700 (PDT), powah wong_po...@yahoo.ca wrote: Thank you for your hint. This is my solution: f = open('test', 'r') for line in f: print line[0].upper()+line[1:], Will your program handle empty lines of input correctly?

Re: Fast Dictionary Access

2009-06-27 Thread Scott David Daniels
Thomas Lehmann wrote: In C++, programming STL you will use the insert method which always provides a position and a flag which indicates whether the position results from a new insertion or an exisiting element. Idea is to have one search only. code if data.has_key(key): value = data[key]

Re: Python Imaging Library download link broken?

2009-06-27 Thread Scott David Daniels
olivergeorge wrote: Ditto. Anyone know what's happening with pythonware? (and why PIL is such a pain to install for that matter.) (1) It is usually there; be patient. (2) I suggest you demand a refund. --Scott David Daniels scott.dani...@acm.org --

Re: change the first character of the line to uppercase in a text file

2009-06-27 Thread Emile van Sebille
On 6/27/2009 1:25 PM MRAB said... Emile van Sebille wrote: On 6/27/2009 3:39 AM Angus Rodgers said... On Fri, 26 Jun 2009 18:58:27 -0700 (PDT), powah wong_po...@yahoo.ca wrote: Thank you for your hint. This is my solution: f = open('test', 'r') for line in f: print

Re: The Python Way for module configuration?

2009-06-27 Thread Aaron Sherman
On Jun 27, 4:38 pm, MRAB pyt...@mrabarnett.plus.com wrote: I would appreciate your comments and suggestions. There are already modules which provide access to databases. As you can see the Python Way is to be rude ;-) Anyway, your answer is that there are some abstraction layers called

Re: What does Guido want in a GUI toolkit for Python?

2009-06-27 Thread Martin v. Löwis
I sorta' wish he'd just come out and say, This is what I think would be suitable for a GUI toolkit for Python: He is not in the business of designing GUI toolkits, but in the business of designing programming languages. So he abstains from specifying (or even recommending) a GUI library.

[RELEASED] Python 3.1 final

2009-06-27 Thread Benjamin Peterson
On behalf of the Python development team, I'm thrilled to announce the first production release of Python 3.1. Python 3.1 focuses on the stabilization and optimization of the features and changes that Python 3.0 introduced. For example, the new I/O system has been rewritten in C for speed. File

Re: postgreSQL python bindings - which one?

2009-06-27 Thread Horace Blegg
On Sat, Jun 27, 2009 at 10:23 AM, Philip Semanchuk phi...@semanchuk.comwrote: On Jun 27, 2009, at 8:27 AM, Albert Hopkins wrote: On Fri, 2009-06-26 at 21:10 -0700, Horace Blegg wrote: Hi, I'm having a hard time deciding which set of PGSQL python bindings to go with. I don't know much

Re: Good books in computer science?

2009-06-27 Thread Robert Kern
On 2009-06-27 07:58, Paul Rubin wrote: Albert van der Horstalb...@spenarnc.xs4all.nl writes: Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Thanks. I lost that title a while ago, must buy. Wait a few months, a third edition is in

tokenize module

2009-06-27 Thread Jim
I'm trying to understand the output of the tokenize.generate_tokens() generator. The token types returned seem to be more general than I'd expect. For example, when fed the following line of code: def func_a(): the (abbreviated) returned token tuples are as follows: (NAME,def,

Re: The Python Way for module configuration?

2009-06-27 Thread kj
In c91011ad-b52c-4fb7-8e2c-1de165636...@d32g2000yqh.googlegroups.com Aaron Sherman aaronjsher...@gmail.com writes: On Jun 27, 4:38=A0pm, MRAB pyt...@mrabarnett.plus.com wrote: I would appreciate your comments and suggestions. There are already modules which provide access to databases. As

Re: Good books in computer science?

2009-06-27 Thread Bearophile
Albert van der Horst: For programming practice I do the problems of http://projecteuler.net/ Time ago I have solved some of them with Python, D and C (some of them are quite hard for me), I have tried to produce very fast code (like a D generator for prime numbers that's like 100 times faster

Re: looking for a book on python

2009-06-27 Thread Randy Foiles
OdarR wrote: On 27 juin, 02:48, Randy Foiles ab...@127.0.0.1 wrote: Hello and thank you for taking your time to read this. I was interested in learning about python. In the long ago past I did learn some programing but I have not used any of it for years. I do remember some basics

Re: looking for a book on python

2009-06-27 Thread Randy Foiles
Aahz wrote: In article s%d1m.1325$9l4@nwrddc01.gnilink.net, Randy Foiles ab...@127.0.0.1 wrote: I do realize that everyone is different but I would like to see some suggestions and maybe reasons why you think it is good. I have looked for/searched and found a few different books but as

Re: looking for a book on python

2009-06-27 Thread Randy Foiles
laplacia...@gmail.com wrote: On Jun 26, 8:48 pm, Randy Foiles ab...@127.0.0.1 wrote: Hello and thank you for taking your time to read this. I was interested in learning about python. In the long ago past I did learn some programing but I have not used any of it for years. I do

Re: encoding problem

2009-06-27 Thread dejan todorović
It was problem with pymssql that not supports unicode, switched to pyodbc, everything is fine. Thanks for your swift reply. ;) On Jun 27, 7:44 pm, Piet van Oostrum p...@cs.uu.nl wrote: netpork todorovic.de...@gmail.com (n) wrote: n Hello, n I have ssl socket with server and client, on my

Re: The Python Way for module configuration?

2009-06-27 Thread Petr Messner
Hi, 2009/6/28 kj no.em...@please.post: ... What I'm interested in is the general problem of providing configuration parameters to a module. Some database/ORM libraries are configured via simple strings in the form dialect://user:passw...@host/dbname[?key=value..], for example

Re: Beginning with Python; the right choice?

2009-06-27 Thread Dave Angel
sato.ph...@gmail.com wrote: Hi, As you can imagine, I am new, both to this group and to Python. I have read various posts on the best book to buy or online tutorial to read and have started to go through them. I was wondering, as someone with virtually no programming experience (I am a

  1   2   >