Re: Measuring Fractal Dimension ?

2009-06-27 Thread Paul Rubin
Steven D'Aprano writes: > Depends on how you define "discontinuous". The mathematical way, of course. For any epsilon > 0, etc. > Catastrophe theory is full of discontinuous changes in state. Animal > (by which I include human) behaviour often displays discontinuous > changes. So does chemist

Re: Beginning with Python; the right choice?

2009-06-27 Thread Zaphod
snip > 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/ > > ShowMeDo.com has lots of Python instructional videos, including this one > for absolute beginners: > http://showmedo.com/videotutorials/s

Re: Measuring Fractal Dimension ?

2009-06-27 Thread Steven D'Aprano
On Thu, 25 Jun 2009 12:23:07 +0100, Robin Becker wrote: > Paul Rubin wrote: [...] >> No really, it is just set theory, which is a pretty bogus subject in >> some sense. There aren't many discontinuous functions in nature. Depends on how you define "discontinuous". Catastrophe theory is full of

Re: Fast Dictionary Access

2009-06-27 Thread Steven D'Aprano
On Sat, 27 Jun 2009 09:41:13 -0700, Rachel P wrote: [...] > Raymond Raymond, does Rachel know you're using her gmail account? *wink* -- Steven -- 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 Steven D'Aprano
On Sat, 27 Jun 2009 19:55:17 +0200, Piet van Oostrum wrote: >> Terry Reedy (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

Re: The Python Way for module configuration?

2009-06-27 Thread Steven D'Aprano
On Sun, 28 Jun 2009 13:28:31 +1000, Ben Finney wrote: > (Even if you don't want to receive email, could you please give your > actual name in the ‘From’ field instead of just initials? It makes > conversation less confusing.) Some people prefer to be known by their initials. Some people's legal

Re: Measuring Fractal Dimension ?

2009-06-27 Thread Paul Rubin
Robin Becker writes: > > There is a philosophy of mathematics (intuitionism) that says... > > there are NO discontinuous functions. > so does this render all the discreteness implied by quantum theory > unreliable? or is it that we just cannot see(measure) the continuity > that really happens?

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

2009-06-27 Thread Kay Schluehr
On 27 Jun., 23:06, "Martin v. Löwis" wrote: > > 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 abstain

Re: The Python Way for module configuration?

2009-06-27 Thread Carl Banks
On Jun 27, 3:18 pm, kj wrote: > In Aaron > Sherman writes: > > >On Jun 27, 4:38=A0pm, MRAB 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 an

Re: No trees in the stdlib?

2009-06-27 Thread João Valverde
Miles Kaufmann wrote: João Valverde wrote: To answer the question of what I need the BSTs for, without getting into too many boring details it is to merge and sort IP blocklists, that is, large datasets of ranges in the form of (IP address, IP address, string). Originally I was also serializin

Re: The Python Way for module configuration?

2009-06-27 Thread Ben Finney
(Even if you don't want to receive email, could you please give your actual name in the ‘From’ field instead of just initials? It makes conversation less confusing.) kj writes: > But, minimally, the module needs to have some configuration details to > know where to get the data. There are many w

Re: No trees in the stdlib?

2009-06-27 Thread Miles Kaufmann
João Valverde wrote: To answer the question of what I need the BSTs for, without getting into too many boring details it is to merge and sort IP blocklists, that is, large datasets of ranges in the form of (IP address, IP address, string). Originally I was also serializing them in a binary

Re: The Python Way for module configuration?

2009-06-27 Thread Dave Angel
kj wrote: In Aaron Sherman writes: On Jun 27, 4:38=A0pm, MRAB 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

Re: No trees in the stdlib?

2009-06-27 Thread João Valverde
alex23 wrote: João Valverde wrote: Currently I don't have a strong need for this. And clearly neither has anyone else, hence the absence from the stdlib. As others have pointed out, there are alternative approaches, and plenty of recipes on ActiveState, which seem to have scratched wh

Re: No trees in the stdlib?

2009-06-27 Thread alex23
João Valverde wrote: > Currently I don't have a strong need for this. And clearly neither has anyone else, hence the absence from the stdlib. As others have pointed out, there are alternative approaches, and plenty of recipes on ActiveState, which seem to have scratched whatever itch there is for

Re: Clobbered 2.6 binary under Frameworks.python, reinstall fails

2009-06-27 Thread ChollaPete
On Jun 27, 5:32 pm, ChollaPete wrote: > Mac OS  X (Tiger 10.4), running Python 2.6 downloaded from python.org > as a DMG installer. > > I clobbered the python binary in /Library/Frameworks/Python.frameworks/ > Versions/Current/bin, so I tried to reinstall from the python.org > 2.6.2 DMG installer.

Re: [Python-Dev] [RELEASED] Python 3.1 final

2009-06-27 Thread Nick Coghlan
Benjamin Peterson wrote: > On behalf of the Python development team, I'm thrilled to announce the first > production release of Python 3.1. Excellent news! Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --

Clobbered 2.6 binary under Frameworks.python, reinstall fails

2009-06-27 Thread ChollaPete
Mac OS X (Tiger 10.4), running Python 2.6 downloaded from python.org as a DMG installer. I clobbered the python binary in /Library/Frameworks/Python.frameworks/ Versions/Current/bin, so I tried to reinstall from the python.org 2.6.2 DMG installer. No joy. Install fails at the end with no helpfu

Re: looking for a book on python

2009-06-27 Thread Aahz
In article , Randy Foiles wrote: >OdarR wrote: >> >> "Learning Python" >> http://oreilly.com/catalog/9780596513986/ >> >> new issue soon, covering 2.6 and 3 >> http://oreilly.com/catalog/9780596158064/?CMP=AFC-ak_book&ATT=Learning+Python%2c+Fourth+Edition%2c > >I was thinking of that book and

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 photogr

Re: The Python Way for module configuration?

2009-06-27 Thread Petr Messner
Hi, 2009/6/28 kj : ... > 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 "mysql://me:topsec...@localhost/

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 wrote: > > netpork (n) wrote: > >n> Hello, > >n> I have ssl socket with server and client, on my development machine > >n> ev

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

Re: looking for a book on python

2009-06-27 Thread Randy Foiles
Aahz wrote: In article , Randy Foiles 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 my means are a bit limited right now I don't really wa

Re: looking for a book on python

2009-06-27 Thread Randy Foiles
OdarR wrote: On 27 juin, 02:48, Randy Foiles 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 book

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: The Python Way for module configuration?

2009-06-27 Thread kj
In Aaron Sherman writes: >On Jun 27, 4:38=A0pm, MRAB 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 la

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: Good books in computer science?

2009-06-27 Thread Robert Kern
On 2009-06-27 07:58, Paul Rubin wrote: Albert van der Horst 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 "Numeric

Re: postgreSQL python bindings - which one?

2009-06-27 Thread Horace Blegg
On Sat, Jun 27, 2009 at 10:23 AM, Philip Semanchuk wrote: > > 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

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

Re: The Python Way for module configuration?

2009-06-27 Thread Aaron Sherman
On Jun 27, 4:38 pm, MRAB 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 "ORMs". You can grab one

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

Re: The Python Way for module configuration?

2009-06-27 Thread MRAB
kj wrote: [PYTHON NOOB ALERT] I want to write a module that serves as a Python front-end to a database. This database can be either in the form of tab-delimited flat files, XML files, or a PostgreSQL server. The module is meant to hide these database implementation details from its users.

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

2009-06-27 Thread laplacia...@gmail.com
On Jun 27, 1:47 pm, Terry Reedy wrote: > laplacia...@gmail.com wrote: > > > So, what *does* Guido want in a GUI toolkit for Python? > > What he did say is "But it hasn't really gotten any less complex to > create the simplest of simple UIs. And that's a shame. When is Microsoft > going to learn th

The Python Way for module configuration?

2009-06-27 Thread kj
[PYTHON NOOB ALERT] I want to write a module that serves as a Python front-end to a database. This database can be either in the form of tab-delimited flat files, XML files, or a PostgreSQL server. The module is meant to hide these database implementation details from its users. But, minima

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

2009-06-27 Thread MRAB
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 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 corr

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 -- http://mail.python.org/mailman/listinfo/pyt

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. if data.has_key(key): value = data[key] But

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 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? It will when the

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 use

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 ind

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

2009-06-27 Thread Piet van Oostrum
> Terry Reedy (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. Other

Re: looking for a book on python

2009-06-27 Thread Aahz
In article , Kee Nethery 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) <*> http://www.pythoncraft.com/ "as long as we like t

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

2009-06-27 Thread Piet van Oostrum
> netpork (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> script.

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

Re: Good books in computer science?

2009-06-27 Thread Terry Reedy
A Steven D'Aprano wrote: On 2009-06-14 14:04:02 +0100, Steven D'Aprano 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 for a *theoretical* physicist to have said. Who got his start *doing* ca

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 stumbl

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 he

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 startin

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 ex

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

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 stra

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 didn't

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 f

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 progra

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. > > > if  data.has_key(key): >    value = data[key

Re: to use unicode strings only

2009-06-27 Thread Benjamin Peterson
Gaudha 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: 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 AM,

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

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 unicod

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 i

Re: file transfer in python

2009-06-27 Thread vasudevram
On Jun 26, 5:07 pm, Francesco Bochicchio wrote: > On 26 Giu, 13:38, jayesh bhardwaj 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 my own module using low level socket

Re: Beginning with Python; the right choice?

2009-06-27 Thread 疯图灵
On 6月27日, 上午10时22分, "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 progra

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

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,

Re: to use unicode strings only

2009-06-27 Thread Benjamin Peterson
Gaudha 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 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: 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: Good books in computer science?

2009-06-27 Thread Paul Rubin
Albert van der Horst 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 FORTRAN/Pascal/C"

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 -- http://ma

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

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

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 h

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 prog

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: 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. -- http://mail.python.org/mailman/listin

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

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

Re: Fast Dictionary Access

2009-06-27 Thread Duncan Booth
Thomas Lehmann 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. > > > if data.has_key(key): >

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

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: 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 -- http://mail.python.org/mai

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'

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

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

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 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 -- http://mail.python.org/mailman/listinf

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 wrote: >On Jun 26, 4:51 pm, Chris Rebert wrote: >> On Fri, Jun 26, 2009 at 12:43 PM, powah wrote: >> > How to change the first character of the line to uppercase in a text >> > file? >> > [...] >> >> We're not in the business of doing homework. So

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
In article <7xocssvzrh@ruckus.brouhaha.com>, Paul Rubin wrote: >koranthala 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 programming wa

Re: Fast Dictionary Access

2009-06-27 Thread Paul Rubin
Thomas Lehmann writes: > > if data.has_key(key): >value = data[key] > > > 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 None if the key is not in the dictiona

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

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 wrote: >> On 2009-06-14 14:04:02 +0100, Steven D'Aprano >> 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 for a *

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 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 else. > >I think there are a

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: Fast Dictionary Access

2009-06-27 Thread Chris Rebert
On Sat, Jun 27, 2009 at 2:47 AM, Thomas Lehmann 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. > >

  1   2   >