MySQLdb install vs. "setuptools"

2010-05-29 Thread John Nagle
MySQLdb won't install as non-root on Python 2.6 because its "setup.py" file requires "setuptools". "setuptools", unlike "distutils", isn't part of the Python 2.6 distribution. IMPORTANT PACKAGES SHOULD NOT USE "setuptools". Use the standard "distutils". "setuptools" and "eggs" create mor

Re: Where does "make altinstall" put stuff?

2010-05-29 Thread casevh
On May 29, 11:06 pm, John Nagle wrote: >    I know that one is supposed to use "make altinstall" to install > versions of Python that won't be the "primary" version.  But what > directory names does it use for packages and other support files? > Is this documented somewhere? > >    I want to make

Re: Where does "make altinstall" put stuff?

2010-05-29 Thread James Mills
On Sun, May 30, 2010 at 4:06 PM, John Nagle wrote: > I know that one is supposed to use "make altinstall" to install > versions of Python that won't be the "primary" version.  But what > directory names does it use for packages and other support files? > Is this documented somewhere? > >  I want t

Re: if, continuation and indentation

2010-05-29 Thread Nathan Rice
I prefer to just break such things into multiple lines. You're doing that already anyhow, it's not much of a speed hit, and it makes exactly what you're testing explicit. If I break a statement onto multiple lines I only use parenthesis, and that is as a last resort. In my opinion there's almost

Where does "make altinstall" put stuff?

2010-05-29 Thread John Nagle
I know that one is supposed to use "make altinstall" to install versions of Python that won't be the "primary" version. But what directory names does it use for packages and other support files? Is this documented somewhere? I want to make sure that no part of the existing Python installatio

Re: Python vs. Fedora and CentOS

2010-05-29 Thread Benjamin Kaplan
And since they're "using legacy stuff that works" from 3 years ago (no one upgrades major versions of software in a minor release- hence Win XP SP3 still coming with IE 6), it's no wonder that they're still on 2.4. On Sat, May 29, 2010 at 9:05 PM, Someone Something wrote: > > Redhat as always bel

Python vs. Fedora and CentOS

2010-05-29 Thread Someone Something
Redhat as always believed in (sorry if this offends anyone): "Use legacy stuff that works, we don't really give a flying hoot if the rest of the world has moved on" On Sat, May 29, 2010 at 6:55 PM, D'Arcy J.M. Cain wrote: > On Sat, 29 May 2010 11:43:29 -0700 > John Nagle wrote: > >The maj

GUI programs

2010-05-29 Thread jyoung79
Just curious if anyone would be willing to share their thoughts about different Python GUI programming modules. I've been doing a bit of research and am trying to find something that: 1. Is portable. Would like to be able to send the module along with the main python file that would be able

Re: if, continuation and indentation

2010-05-29 Thread Mark Lawrence
On 30/05/2010 01:23, john wrote: On May 28, 10:37 am, "Colin J. Williams" wrote: On 28-May-10 05:54 AM, Jonathan Hartley wrote: On May 27, 1:57 pm, Jean-Michel Pichavant wrote: HH wrote: I have a question about best practices when it comes to line wrapping/ continuation and indentation, spec

Re: if, continuation and indentation

2010-05-29 Thread john
On May 28, 10:37 am, "Colin J. Williams" wrote: > On 28-May-10 05:54 AM, Jonathan Hartley wrote: > > > On May 27, 1:57 pm, Jean-Michel Pichavant > > wrote: > >> HH wrote: > >>> I have a question about best practices when it comes to line wrapping/ > >>> continuation and indentation, specifically i

Re: xrange issue 7721

2010-05-29 Thread Mark Lawrence
Hi Martin, thanks for the response, please see below. On 29/05/2010 20:12, Martin Manns wrote: On Sat, 29 May 2010 19:46:28 +0100 Mark Lawrence wrote: I've had an OverflowError using xrange with Python 2.6.5 on Windows. Googling got me to the subject line. msg97928 gives a code snippet to ov

Re: dbf files and indexes

2010-05-29 Thread D'Arcy J.M. Cain
On Sat, 29 May 2010 13:45:37 -0700 (PDT) Bryan wrote: > You're not doing the query optimizer any favors. It can normalize the > query to the same thing either way, so we might as well write it to be > readable by people. I can read D'Arcy's at a glance. Assuming that you are running a decent *cou

Re: Python vs. Fedora and CentOS

2010-05-29 Thread D'Arcy J.M. Cain
On Sat, 29 May 2010 11:43:29 -0700 John Nagle wrote: >The major Red Hat based Linux distros are still shipping with Python 2.4. > >Is anybody trying to do something about this? Other than not running Linux on our hosting server? My ISP (http://www.Vex.Net) runs FreeBSD. Linux is for th

Re: tkinter function outout to text widget

2010-05-29 Thread Alf P. Steinbach
* Johan Lans, on 29.05.2010 22:51: Hi I'm totally new on python and I'm doing an assignement where I'm doing a class that manipulates a text. The program is also supposed to have a GUI, for which I have used tkinter. So far I have entry widgets for file names and buttons, its all working like I w

PLAY CAR RACE GAMES

2010-05-29 Thread KAJAL AGARWAL
PLAY CAR RACE GAMES:- PLAY CAR RACE GAMES ON MY WEB SITE AND ENJOY UR MIND FRESH AND U CAN DOWN LOAD ALSO MY GAMES VISIT http://andhraonlinegames.blogspot,com -- http://mail.python.org/mailman/listinfo/python-list

tkinter function outout to text widget

2010-05-29 Thread Johan Lans
Hi I'm totally new on python and I'm doing an assignement where I'm doing a class that manipulates a text. The program is also supposed to have a GUI, for which I have used tkinter. So far I have entry widgets for file names and buttons, its all working like I want it to. What is missing is a way t

Re: dbf files and indexes

2010-05-29 Thread Bryan
Christian Heimes wrote: [D'Arcy J.M. Cain had written:] > > SELECT * FROM NumberOfPets > > WHERE name IN (SELECT name FROM CatLovers) OR > >    name IN (SELECT name FROM DogLovers) > > ORDER BY name; > > A good way is to use SQL with JOINs instead of horrible nested > selects. Do show us your joi

Re: Python vs. Fedora and CentOS

2010-05-29 Thread John Nagle
Philip Semanchuk wrote: On May 29, 2010, at 2:58 PM, Paul Rubin wrote: John Nagle writes: The major Red Hat based Linux distros are still shipping with Python 2.4. Fedora 12 ships with Python 2.6, I think. Fedora has been shipping with Python 2.6 since F11 release in June of 2009, and

Re: Free chapter about Python and databases (MySQL and SQLite)

2010-05-29 Thread John Bokma
Robinow writes: > > On May 28, 2010, at 10:05 PM, John Bokma wrote: > >> Sebastian Bassi writes: >> >>> On Fri, May 28, 2010 at 12:37 AM, John Bokma >>> wrote: >> >> Even if it's just a few bucks, it's still money saved [0]. On top of >> that I think it's way better to point your audience to

Re: xrange issue 7721

2010-05-29 Thread Martin Manns
On Sat, 29 May 2010 19:46:28 +0100 Mark Lawrence wrote: > I've had an OverflowError using xrange with Python 2.6.5 on Windows. > Googling got me to the subject line. > > msg97928 gives a code snippet to overcome the limitations of xrange, > allowing for negative steps, however it doesn't raise

Re: Python vs. Fedora and CentOS

2010-05-29 Thread Mike Fedyk
On Sat, May 29, 2010 at 12:03 PM, Wesley Brooks wrote: > On 29 May 2010 19:58, Paul Rubin wrote: >> John Nagle writes: >>>   The major Red Hat based Linux distros are still shipping with Python 2.4. >> >> Fedora 12 ships with Python 2.6, I think. > > I've got Fedora 10 here with 2.5, and 11 at t

Re: Python vs. Fedora and CentOS

2010-05-29 Thread Philip Semanchuk
On May 29, 2010, at 2:58 PM, Paul Rubin wrote: John Nagle writes: The major Red Hat based Linux distros are still shipping with Python 2.4. Fedora 12 ships with Python 2.6, I think. Fedora has been shipping with Python 2.6 since F11 release in June of 2009, and Python > 2.4 since F7 r

Re: Python vs. Fedora and CentOS

2010-05-29 Thread Wesley Brooks
I've got Fedora 10 here with 2.5, and 11 at the office with 2.6. On 29 May 2010 19:58, Paul Rubin wrote: > John Nagle writes: >>   The major Red Hat based Linux distros are still shipping with Python 2.4. > > Fedora 12 ships with Python 2.6, I think. > -- > http://mail.python.org/mailman/listinf

Re: Python vs. Fedora and CentOS

2010-05-29 Thread Paul Rubin
John Nagle writes: > The major Red Hat based Linux distros are still shipping with Python 2.4. Fedora 12 ships with Python 2.6, I think. -- http://mail.python.org/mailman/listinfo/python-list

xrange issue 7721

2010-05-29 Thread Mark Lawrence
Sorry if this is the wrong ng/ml, but thought I'd better flag this up somewhere. I've had an OverflowError using xrange with Python 2.6.5 on Windows. Googling got me to the subject line. msg97928 gives a code snippet to overcome the limitations of xrange, allowing for negative steps, however

Python vs. Fedora and CentOS

2010-05-29 Thread John Nagle
The major Red Hat based Linux distros are still shipping with Python 2.4. As a result, almost all hosting providers are running obsolete versions of Python. The big problem seems to be that "cPanel" and "yum" still use older versions of Python, and those programs are more important to distro

Re: A Friday Python Programming Pearl: random sampling

2010-05-29 Thread Mark Dickinson
On May 29, 3:43 pm, Bryan wrote: > Mark Dickinson wrote: > > N.B.  I don't claim any originality for the algorithm; only for the > > implementation: the algorithm is based on an algorithm attributed to > > Robert Floyd, and appearing in Jon Bentley's 'Programming Pearls' book > > Actually it is th

Re: Help with Regexp, \b

2010-05-29 Thread andrew cooke
On May 29, 11:24 am, Duncan Booth wrote: > andrew cooke wrote: > > Please can someone explain why the following fails: > > >         from re import compile > > >         p = compile(r'\bword\b') > >         m = p.match(' word ') > >         assert m [...] > You misunderstand what \b does: it does

Re: Tkinter library reference

2010-05-29 Thread Godson Gera
Do you mean Tkinter API reference documentation ? If so, this is what I've used years back http://www.nmt.edu/tcc/help/pubs/tkinter.pdf you can also get some info from http://effbot.org/tkinterbook On Sat, May 29, 2010 at 6:41 PM, Pradeep B wrote: > Do we have a standard reference library for

Re: Help with Regexp, \b

2010-05-29 Thread Shashwat Anand
Also what you are probably looking for is this I guess, >>> p = re.compile(r'\bword\b') >>> m = p.match('word word') >>> assert m >>> m.group(0) 'word' On Sat, May 29, 2010 at 8:44 PM, Shashwat Anand wrote: > \b is NOT spaces > > >>> p = re.compile(r'\sword\s') > >>> m = p.match(' word ') > >>>

Re: Help with Regexp, \b

2010-05-29 Thread Duncan Booth
andrew cooke wrote: > Please can someone explain why the following fails: > > from re import compile > > p = compile(r'\bword\b') > m = p.match(' word ') > assert m > > My understanding is that \b matches a space at the start or end of a > word, and that "word"

Re: Help with Regexp, \b

2010-05-29 Thread Shashwat Anand
\b is NOT spaces >>> p = re.compile(r'\sword\s') >>> m = p.match(' word ') >>> assert m >>> m.group(0) ' word ' >>> On Sat, May 29, 2010 at 8:34 PM, andrew cooke wrote: > > This is a bit embarassing, but I seem to be misunderstanding how \b > works in regexps. > > Please can someone explain wh

Help with Regexp, \b

2010-05-29 Thread andrew cooke
This is a bit embarassing, but I seem to be misunderstanding how \b works in regexps. Please can someone explain why the following fails: from re import compile p = compile(r'\bword\b') m = p.match(' word ') assert m My understanding is that \b matches a space a

Re: A Friday Python Programming Pearl: random sampling

2010-05-29 Thread Bryan
Mark Dickinson wrote: > N.B.  I don't claim any originality for the algorithm; only for the > implementation: the algorithm is based on an algorithm attributed to > Robert Floyd, and appearing in Jon Bentley's 'Programming Pearls' book Actually it is the sequel, /More Programming Pearls/. > (thou

Re: Creating a single list

2010-05-29 Thread superpollo
Astley Le Jasper ha scritto: This is probably a really silly question but, given the example code at the bottom, how would I get a single list? What I currently get is: ('id', 20, 'integer') ('companyname', 50, 'text') [('focus', 30, 'text'), ('fiesta', 30, 'text'), ('mondeo', 30, 'text'), ('pu

Re: Python and Tkinter Programming by John Grayson

2010-05-29 Thread Kevin Walzer
Is printing from GUI still a 'not-happening' thing with Tkinter ? I have just started learning it. Tkinter doesn't wrap native printing API's. There are a few extensions that do it, but they are platform specific and not complete. The usual ways of printing are like this: 1. If you're outp

Re: Creating a single list

2010-05-29 Thread Xavier Ho
> # Insert into the list with slicing syntax. >column_title_list[2:3} = getproduct() > Sorry, that should have been [2:3]. Typing a bit too fast. -Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a single list

2010-05-29 Thread Xavier Ho
On 29 May 2010 23:24, Astley Le Jasper wrote: > def createlist(): >column_title_list = ( >("id",20,"integer"), >("companyname",50,"text"), >getproducts(), >

Creating a single list

2010-05-29 Thread Astley Le Jasper
This is probably a really silly question but, given the example code at the bottom, how would I get a single list? What I currently get is: ('id', 20, 'integer') ('companyname', 50, 'text') [('focus', 30, 'text'), ('fiesta', 30, 'text'), ('mondeo', 30, 'text'), ('puma', 30, 'text')] ('contact', 5

Tkinter library reference

2010-05-29 Thread Pradeep B
Do we have a standard reference library for Tkinter available? -- Pradeep -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Tkinter Programming by John Grayson

2010-05-29 Thread Pradeep B
On Fri, Jan 22, 2010 at 6:48 AM, Ethan Furman wrote: > Peter wrote: >> >> On Jan 15, 9:12 am, Kevin Walzer wrote: On Jan 15, 6:24 am, Mark Roseman  wrote: > >  Peter  wrote: >> >> Besides, the book is mainly about using Python with Tkinter - and >> Tkinter hasn't cha

Py_single_input and the side-effects...

2010-05-29 Thread moerchendiser2k3
Hi at all, I have a small problem with Py_single_input, that I dont really know what it actually does. I created my own interactive interpreter loop and when I create objects like p = TestObject() this instance is just deleted on Py_Finalize() even I delete the entire console scope long time be

Re: A Friday Python Programming Pearl: random sampling

2010-05-29 Thread Xavier Ho
On 29 May 2010 06:44, Mark Dickinson wrote: > But I was struck by its beauty and > simplicity, and thought it deserved to be better known. > Wow, that took me at least 2 minutes to see its beauty as well. Nice find, Mark. Thanks for sharing. (Also, it's nice to see another SOer on Python-List a