Re: Trouble getting loop to break

2007-11-25 Thread Dick Moores
At 01:32 PM 11/20/2007, Fredrik Johansson wrote: On Nov 20, 2007 10:00 PM, Dick Moores [EMAIL PROTECTED] wrote: And also with the amazing Chudnovsky algorithm for pi. See http://python.pastebin.com/f4410f3dc Nice! I'd like to suggest two improvements for speed. First, the Chudnovsky

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-25 Thread Peter Otten
Steven D'Aprano wrote: store = {} def atom(str): global store if str not in store: store[str] = str return store[str] Oh lordy, that's really made my day! That's the funniest piece of code I've seen for a long time! Worthy of being submitted to the DailyWTF.

Re: import pysqlite2 or import sqlite3?

2007-11-25 Thread Hertha Steck
Mike MacDonald wrote: On Nov 21, 3:02 pm, Hertha Steck [EMAIL PROTECTED] wrote: Hello, I'm using Python 2.5.1, Pysqlite 2.3.5 and SQLite 3.4.1 on Gentoo Linux. I've always imported pysqlite using from pysqlite2 import dbapi2 and that works. If I try ... Suppose I run the following

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-25 Thread Licheng Fang
On Nov 25, 5:59 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sat, 24 Nov 2007 03:44:59 -0800, Licheng Fang wrote: On Nov 24, 7:05 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Licheng Fang wrote: I find myself frequently in need of classes like this for

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-25 Thread Steven D'Aprano
On Sun, 25 Nov 2007 10:39:38 +0100, Peter Otten wrote: So if you are going to submit Sam's function make sure to bundle it with this little demo... Well Peter, I was going to reply with a comment about not changing the problem domain (tuples of ints to trigrams from a text file for natural

Re: Trouble getting loop to break

2007-11-25 Thread John Machin
On Nov 25, 7:00 pm, Dick Moores [EMAIL PROTECTED] wrote: At 01:32 PM 11/20/2007, Fredrik Johansson wrote: On Nov 20, 2007 10:00 PM, Dick Moores [EMAIL PROTECTED] wrote: And also with the amazing Chudnovsky algorithm for pi. See http://python.pastebin.com/f4410f3dc Nice! I'd like

Re: Trouble getting loop to break

2007-11-25 Thread Fredrik Johansson
On Nov 25, 2007 9:00 AM, Dick Moores [EMAIL PROTECTED] wrote: Fredrik, I'm afraid I'm just too dumb to see how to use your first suggestion of cached_factorials. Where do I put it and def()? Could you show me, even on-line, what to do? http://py77.python.pastebin.com/f48e4151c You (or

Re: import pysqlite2 or import sqlite3?

2007-11-25 Thread MonkeeSage
I use the following for a progam I wrote using sqlite, to ensure maximum compatibility (since the API is the same, importing them both as 'sqlite' should be fine): try: from sqlite3 import dbapi2 as sqlite # python 2.5 except: try: from pysqlite2 import dbapi2 as sqlite except:

Re: Recursive loading trouble for immutables

2007-11-25 Thread Mel
rekkufa wrote: I am currently building a system for serializing python objects to a readable file-format, as well as creating python objects by parsing the same format. It is more or less complete except for a single issue I just cannot figure out by myself: How to load data that

Re: the annoying, verbose self

2007-11-25 Thread Colin J. Williams
Steven D'Aprano wrote: On Fri, 23 Nov 2007 23:38:24 +, BJörn Lindqvist wrote: I like that a lot. This saves 12 characters for the original example and removes the need to wrap it. 7return math.sqrt(.x * .x + .y * .y + .z * .z) +1 Readability counts, even on small

Re: How to display unicode with the CGI module?

2007-11-25 Thread paul
Marc 'BlackJack' Rintsch schrieb: On Sat, 24 Nov 2007 15:58:56 -0800, coldpizza wrote: The problem I am having is that I get an error while trying to display Unicode UTF-8 characters via a Python CGI script. The error goes like this: UnicodeEncodeError: 'ascii' codec can't encode character

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-25 Thread MonkeeSage
On Nov 24, 6:42 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: This has nothing, absolutely NOTHING, to do with memoization. Memoization trades off memory for time, allowing slow functions to return results faster at the cost of using more memory. The OP wants to save memory,

Re: the annoying, verbose self

2007-11-25 Thread Colin J. Williams
Kay Schluehr wrote: Colin J. Williams schrieb: Kay Schluehr wrote: On Nov 22, 8:43 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Colin J. Williams a écrit : [EMAIL PROTECTED] wrote: Alexy: Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to use Ruby

Re: the annoying, verbose self

2007-11-25 Thread MonkeeSage
I like the explicit self, personally. It helps distinguish class methods from functions. When I see a self I think A-ha, a class method. Of course, I could tell that from just the indentation and following that back to the class declaration, but as a quick reference I find it helpful. Besides,

Re: the annoying, verbose self

2007-11-25 Thread samwyse
On Nov 24, 1:10 pm, Patrick Mullen [EMAIL PROTECTED] wrote: If there were a using or if the with statement would handle something like this, I wouldn't use it. s. is only 2 characters. I saw chained dots mentioned. Chained dots are 2 characters. Why are we still discussing this? s. is the

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-25 Thread Colin J. Williams
Steven D'Aprano wrote: On Sun, 25 Nov 2007 01:38:51 +0100, Hrvoje Niksic wrote: samwyse [EMAIL PROTECTED] writes: create a hash that maps your keys to themselves, then use the values of that hash as your keys. The atom function you describe already exists under the name intern. Not

Re: Installing modules via setuptools in a script

2007-11-25 Thread Thorsten Kampe
* Robert Kern (Sat, 24 Nov 2007 16:33:37 -0600) Thorsten Kampe wrote: can anyone give me a short code snippet how to install a missing module via setuptools (assuming setuptools is already installed)?! Something like this: try: import missing_module except import_error

Re: Trouble getting loop to break

2007-11-25 Thread Dick Moores
At 03:26 AM 11/25/2007, Fredrik Johansson wrote: On Nov 25, 2007 9:00 AM, Dick Moores [EMAIL PROTECTED] wrote: Fredrik, I'm afraid I'm just too dumb to see how to use your first suggestion of cached_factorials. Where do I put it and def()? Could you show me, even on-line, what to do?

Re: the annoying, verbose self

2007-11-25 Thread Andrew Koenig
Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Alternatively, as someone else suggested, an analogue of the Pascal with could be used: def abs(self): with self: return math.sqrt(x**2 + y**2 + z**2) How does your suggested with statement know to transform

Re: OPLC purchase period extended

2007-11-25 Thread GHUM
[http://laptopgiving.org/en/terms-and-conditions.php] I'm sure that some people would be willing to serve as middleware... So, which US-Pythoneer is willing to serve as middleware for my buying of the XO? Please contact me. Harald -- GHUM Harald Massa persuadere et programmare Harald

Re: the annoying, verbose self

2007-11-25 Thread Colin J. Williams
Andrew Koenig wrote: Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Alternatively, as someone else suggested, an analogue of the Pascal with could be used: def abs(self): with self: return math.sqrt(x**2 + y**2 + z**2) How does your suggested with

RE: the annoying, verbose self

2007-11-25 Thread Andrew Koenig
I am not advocating this, but this could be: def abs(self): with self: with math: return sqrt(x**2 + y**2 + z**2) The idea being that with self use creates a new namespace: newGlobal= oldGlobal + oldLocal newLocal= names from self You don't know what those names

PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Alexander Tuchacek
hallo, i try to adress an qt object self.statusbar.showMessage(rtt %s % (n.rtt)) in an callback function, comming from a shared lib importet by ctypes, on osx this works wonderfull when i run the same code on linux (ubuntu gutsy), i get this core dump, ok, i understand that the problem

Re: the annoying, verbose self

2007-11-25 Thread MonkeeSage
The issue of lexical scope still looms large on the horizon. How does one distinguish between attributes (as scoped by the with clause), local/global variables, and function/method calls? There doesn't seem to be an easy way. You'd need multiple passes over the data to determine various scopes --

Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Bjoern Schliessmann
Alexander Tuchacek wrote: i try to adress an qt object self.statusbar.showMessage(rtt %s % (n.rtt)) in an callback function, comming from a shared lib importet by ctypes, on osx this works wonderfull when i run the same code on linux (ubuntu gutsy), i get this core dump, ok, i

You have come? Definitely you have not gone

2007-11-25 Thread shoplifes
Dear Friends The Shoplifes.com belongs to Shoplife Limited Company who mainly sell personal stylish electronic consumable products such as Mobile phones, Laptops, Digital Cameras, Digital Videos,Mp3,Mp4 and bulk products such as LCD TV, Motorcycles and so on. The specific item please visit our

Re: the annoying, verbose self

2007-11-25 Thread Colin J. Williams
Andrew Koenig wrote: I am not advocating this, but this could be: def abs(self): with self: with math: return sqrt(x**2 + y**2 + z**2) The idea being that "with self" use creates a new namespace: newGlobal= oldGlobal +

Re: the annoying, verbose self

2007-11-25 Thread Colin J. Williams
MonkeeSage wrote: The issue of lexical scope still looms large on the horizon. How does one distinguish between attributes (as scoped by the with clause), local/global variables, and function/method calls? There doesn't seem to be an easy way. You'd need multiple passes over the data to

Re: OPLC purchase period extended

2007-11-25 Thread Grant Edwards
On 2007-11-25, Aahz [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Grant Edwards [EMAIL PROTECTED] wrote: The most imporant thing is that the control key is to the left of the A keay where god intened. Not too surprising when you realized the design was headed by folks from the media

Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread David Boddie
On Sun Nov 25 15:22:24 CET 2007, Alexander Tuchacek wrote: i try to adress an qt object self.statusbar.showMessage(rtt %s % (n.rtt)) in an callback function, comming from a shared lib importet by ctypes, on osx this works wonderfull when i run the same code on linux (ubuntu

Re: Recursive loading trouble for immutables

2007-11-25 Thread Mel
Mel wrote: rekkufa wrote: [ ... ] How to load data that specifies immutables that recursively reference themselves. I can imagine a C function that might do it. [ ... ] Here's something that works, in the sense of creating a tuple containing a self-reference. I don't know how dangerous it

Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Alexander Tuchacek
David Boddie wrote: You can either construct some sort of event handling mechanism or use signals and slots. Personally, I'd use signals and slots for this, if possible. The idea would be to set up a connection between your callback code and the status bar's showMessage() slot. Then you

How to Teach Python Variables

2007-11-25 Thread none
Hello, IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble getting loop to break

2007-11-25 Thread Fredrik Johansson
On Nov 25, 2007 2:47 PM, Dick Moores [EMAIL PROTECTED] wrote: Wow. your f() is ingenious, Frederik. Thanks very much. Any more tricks up your sleeve? You did say a post or so ago, Further improvements are possible. The next improvement would be to find a recurrence formula for the terms

basic if stuff- testing ranges

2007-11-25 Thread Donn Ingle
Sheesh, I've been going spare trying to find how to do this short-hand: if 0 x 20: print within So that x must be 0 and 20. I usually do: if x 0 and x 20: print within What's the rule? Does it even exist? I read something like it recently on the list but can't find it, that's where I got

Re: basic if stuff- testing ranges

2007-11-25 Thread Mel
Donn Ingle wrote: Sheesh, I've been going spare trying to find how to do this short-hand: if 0 x 20: print within So that x must be 0 and 20. I usually do: if x 0 and x 20: print within What's the rule? Does it even exist? if 0 x 20: ? Mel. --

Re: basic if stuff- testing ranges

2007-11-25 Thread Aurélien Campéas
Donn Ingle a écrit : Sheesh, I've been going spare trying to find how to do this short-hand: if 0 x 20: print within you mean : 0 x 20 ? or x in xrange(1,20) ? So that x must be 0 and 20. I usually do: if x 0 and x 20: print within What's the rule? Does it even exist? is

Re: How to Teach Python Variables

2007-11-25 Thread Aurélien Campéas
none a écrit : Hello, IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami That's something I've often heard and I don't get it. Somehow

[ANN] pysqlite 2.4.0 released

2007-11-25 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pysqlite 2.4.0 released === I'm pleased to announce the availability of pysqlite 2.4.0. This is a release with major new features. Go to http://pysqlite.org/ for downloads, online documentation and reporting bugs. What is

Re: How to Teach Python Variables

2007-11-25 Thread Diez B. Roggisch
Aurélien Campéas schrieb: none a écrit : Hello, IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami That's something I've often heard

Re: How to Teach Python Variables

2007-11-25 Thread none
Aurélien Campéas wrote: none a écrit : Hello, IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami That's something I've often heard and

Re: How to Teach Python Variables

2007-11-25 Thread Aahz
In article [EMAIL PROTECTED], none atavory\@(none) wrote: IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link?

Re: basic if stuff- testing ranges

2007-11-25 Thread John Machin
On Nov 26, 5:49 am, Donn Ingle [EMAIL PROTECTED] wrote: Sheesh, I've been going spare trying to find how to do this short-hand: if 0 x 20: print within That means if x LESS THAN 0 and x 20. So that x must be 0 and 20. So try if 0 x 20: I usually do: if x 0 and x 20: print

Re: How to Teach Python Variables

2007-11-25 Thread Andrew Koenig
Aurélien Campéas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I mean : aren't C variables also bindings from names to objects ? Or what ? No, they're not. In C, when you execute x = y; you cause x to become a copy of y. In Python, when you execute x = y you cause x

Re: OPLC purchase period extended

2007-11-25 Thread Paul Rubin
Grant Edwards [EMAIL PROTECTED] writes: The most imporant thing is that the control key is to the left of the A keay where god intened. Not too surprising when you realized the design was headed by folks from the media lab at MIT. MIT requires everybody to use Emacs, right? You've got to

Re: How to Teach Python Variables

2007-11-25 Thread none
Aahz wrote: In article [EMAIL PROTECTED], none atavory\@(none) wrote: IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link?

Re: OPLC purchase period extended

2007-11-25 Thread Grant Edwards
On 2007-11-25, Paul Rubin http wrote: You've got to remember that the OLPC was made for little kids, and as such, the keyboard is quite small. Also, because of its expected physical environment, the keyboard is water resistant (membrane cover). These two things make the OLPC difficult

Re: How to Teach Python Variables

2007-11-25 Thread Bjoern Schliessmann
Aurélien Campéas wrote: I mean : aren't C variables also bindings from names to objects ? No, C variables are aliases for memory addresses. Regards, Björn -- BOFH excuse #390: Increased sunspot activity. -- http://mail.python.org/mailman/listinfo/python-list

win32serviceutil won't start

2007-11-25 Thread Nikola Skoric
I have a very simple win32serviceutil script: import win32serviceutil, time win32serviceutil.StartService(burek, localhost) time.sleep(10) exit() It successfuly imports win32serviceutil, and chokes on StartService: Traceback (most recent call last): File foobar.py, line 3, in ?

Re: OPLC purchase period extended

2007-11-25 Thread Paul Rubin
Grant Edwards [EMAIL PROTECTED] writes: It's not going to be a full-time computer. It's mostly going to be something to play with -- though using it in tablet mode as an e-book reader sounds like it might work. It is fairly nice for that. It's especially cool that the screen works outdoors

Greylisting with Kamaelia (was Re: Python North-West meeting - 6 november 18.30)

2007-11-25 Thread Michael Sparks
Giacomo Lacava wrote: New meeting of the Python North-West UK community! This month's talk is: - Michael Sparks on Greylisting with Kamaelia - Just a small note that the slides from this are now up here: http://www.slideshare.net/kamaelian/kamaelia-grey With the main page on the

Re: How to display unicode with the CGI module?

2007-11-25 Thread coldpizza
Unicode != UTF-8. ... `encode()` method is your friend. Thanks a lot for help! I am always confused as to which one to use: encode() or decode(); I have initially tried decode() and it did not work. It is funny that encode() and decode() omit the name of the other encoding (Unicode ucs2?),

Re: the annoying, verbose self

2007-11-25 Thread Arnaud Delobelle
On Nov 24, 10:55 am, jakub silar [EMAIL PROTECTED] wrote: BJörn Lindqvist wrote: On Nov 22, 2007 2:08 PM, Colin J. Williams [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Alexy: Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to use Ruby anywhere speed is

Re: import pysqlite2 or import sqlite3?

2007-11-25 Thread Nick Craig-Wood
MonkeeSage [EMAIL PROTECTED] wrote: I use the following for a progam I wrote using sqlite, to ensure maximum compatibility (since the API is the same, importing them both as 'sqlite' should be fine): try: from sqlite3 import dbapi2 as sqlite # python 2.5 I've been using import

Re: Subprocess and 16-bit FORTRAN

2007-11-25 Thread Nick Craig-Wood
Federico Ceccatto [EMAIL PROTECTED] wrote: This is the kind of 'bugs' i've run into, perhaps someone could shed some light onto them? - Sometimes execution of child process (in this case, NTVDM.exe and its children) stops and the object is destroyed for no reason whatsoever. Very

Re: win32serviceutil won't start

2007-11-25 Thread kyosohma
On Nov 25, 2:40 pm, Nikola Skoric [EMAIL PROTECTED] wrote: I have a very simple win32serviceutil script: import win32serviceutil, time win32serviceutil.StartService(burek, localhost) time.sleep(10) exit() It successfuly imports win32serviceutil, and chokes on StartService: Traceback

Re: Installing modules via setuptools in a script

2007-11-25 Thread Ben Finney
Thorsten Kampe [EMAIL PROTECTED] writes: * Robert Kern (Sat, 24 Nov 2007 16:33:37 -0600) Thorsten Kampe wrote: can anyone give me a short code snippet how to install a missing module via setuptools (assuming setuptools is already installed)?! The recommended way to handle

Re: basic if stuff- testing ranges

2007-11-25 Thread J. Clifford Dyer
On Sun, 2007-11-25 at 20:49 +0200, Donn Ingle wrote: Sheesh, I've been going spare trying to find how to do this short-hand: if 0 x 20: print within smartAssAnswer if 0 x: print within /smartAssAnswer -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python Variables

2007-11-25 Thread Ben Finney
none atavory\@(none) writes: IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? In addition to the good answers you've had already, I highly recommend David Goodger's Code

Re: win32serviceutil won't start

2007-11-25 Thread Nikola Skoric
Dana Sun, 25 Nov 2007 13:52:35 -0800 (PST), [EMAIL PROTECTED] [EMAIL PROTECTED] kaze: Looks like Microsoft thinks you mis-spelled it. http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/w2000Msgs/3310.mspx?mfr=true I would check and see if that service is installed on your

Re: How to Teach Python Variables

2007-11-25 Thread none
Ben Finney wrote: none atavory\@(none) writes: IIRC, I once saw an explanation how Python doesn't have variables in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? In addition to the good answers you've had already, I highly recommend

image rendering in python

2007-11-25 Thread mobiledreamers
http://cdnll.i.imagechef.com/ic/templimg2/Shaved%20Head.jpg Do u know how to make such images using PIL or other tools in python thanks a lot for your kind help -- http://mail.python.org/mailman/listinfo/python-list

Re: OPLC purchase period extended

2007-11-25 Thread Damjan
It is fairly nice for that. It's especially cool that the screen works outdoors (reflective). I don't know why regular laptops don't do that any more. I think because they can't reproduce colors correctly with reflective light. The OLPC is blackwhite (and grey) when in the reflective outdoor

Re: Python web frameworks

2007-11-25 Thread Jan Claeys
Op Fri, 23 Nov 2007 09:29:38 -0800, schreef BartlebyScrivener: I'm just learning Django and feeling my way through all of this server terminology. Where does Django's memcached feature fit into all of this? When you all speak of start up costs and memory intensive loading for each requests,

Re: How to display unicode with the CGI module?

2007-11-25 Thread Jan Claeys
Op Sun, 25 Nov 2007 13:02:26 -0800, schreef coldpizza: It is funny that encode() and decode() omit the name of the other encoding (Unicode ucs2?), which makes it far less readable than a s.recode('ucs2','utf8'). The internal encoding/representation of a string of Unicode characters is

Re: OPLC purchase period extended

2007-11-25 Thread Grant Edwards
On 2007-11-26, Damjan [EMAIL PROTECTED] wrote: It is fairly nice for that. It's especially cool that the screen works outdoors (reflective). I don't know why regular laptops don't do that any more. I think because they can't reproduce colors correctly with reflective light. It's hard to

multiple selection of cells

2007-11-25 Thread linda.s
Hi, I wonder how to hold the ctrl key and left button (button-1) to do multiple selection of the following items? Thanks, Linda import Tkinter s = Tkinter.Scrollbar() L = Tkinter.Listbox() s.pack(side=Tkinter.RIGHT, fill=Tkinter.Y) L.pack(side=Tkinter.LEFT, fill=Tkinter.Y)

Re: mod_python

2007-11-25 Thread [EMAIL PROTECTED]
On Nov 24, 1:19 am, Vernon Wenberg III [EMAIL PROTECTED] wrote: Why do I receive a File not found error on a perfect good and simple script but properly receive errors when I deliberately add errors in the script? The file is there, it just doesn't do anything. Any help would be appreciated.

Re: basic if stuff- testing ranges

2007-11-25 Thread Donn Ingle
you mean : 0 x 20 ? Yes. I had gotten the impression that there was some Python form of: if NUMBER test VAR test NUMBER: Part of the question was to discover if I was smoking my socks :) x in range(1,20) ? Sure, that's okay, but it has clarity issues, and is calling a func. but then again

Re: basic if stuff- testing ranges

2007-11-25 Thread Donn Ingle
Mel wrote: if 0 x 20: ? I take it I was tripping then. That's okay, it seemed a little too weird anyway :) \d -- http://mail.python.org/mailman/listinfo/python-list

Re: basic if stuff- testing ranges

2007-11-25 Thread Donn Ingle
smartAssAnswer if 0 x: print within /smartAssAnswer Ah, I didn't know you could one could use the sarcasm.xml module and then use tags to influence Python commands. Most interesting... import sarcasm.xml withTongueInCheek I.fartIn( Your.Direction( general ) ) /withTongueInCheek :D \d --

Re: basic if stuff- testing ranges

2007-11-25 Thread Donn Ingle
if 0 x 20: print within That means if x LESS THAN 0 and x 20. Oh, bugger. It's tricky. So try if 0 x 20: Thanks. I was flipping signs in my tests, but I guess I flipped both and got myself all confused. Likely manuals: Tutorial Reference Tutorial: check contents, if statement

Re: Compile Cheetah Template on Windows

2007-11-25 Thread Tim Roberts
brianrpsgt1 [EMAIL PROTECTED] wrote: I have been able to successful pull info from a MySQL DB, get the results and output them in an HTML format using Cheetah to the screen using IDLE. I am doing this on a Windows Laptop, running WinXP, Python 2.5 and the latest version of Cheetah. I have two

i want to know what is the problem in this code

2007-11-25 Thread nani
i am getting the following error for below code type 'exceptions.KeyError'Python 2.5.1: C:\Python25\python.exe Mon Nov 26 10:13:17 2007 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. C:\Program Files\Apache

Very beautiful girls and complete stock information, please check it out

2007-11-25 Thread my glass
Very beautiful girls and complete stock information,please check it out http://groups.google.com/group/all-good-things/web/beautiful-girls-and-ladies -- http://mail.python.org/mailman/listinfo/python-list

Re: import pysqlite2 or import sqlite3?

2007-11-25 Thread MonkeeSage
On Nov 25, 3:30 pm, Nick Craig-Wood [EMAIL PROTECTED] wrote: MonkeeSage [EMAIL PROTECTED] wrote: I use the following for a progam I wrote using sqlite, to ensure maximum compatibility (since the API is the same, importing them both as 'sqlite' should be fine): try: from sqlite3

RE: Recursive loading trouble for immutables

2007-11-25 Thread rekkufa
Mel wrote: ... Here's something that works, in the sense of creating a tuple containing a self-reference. I don't know how dangerous it realliy is ... Thanks for the testing. Given the unknown dangers that might (or might not) lurk with these things, the fact that recursive tuples are never

Re: Code Management

2007-11-25 Thread A.T.Hofkamp
On 2007-11-24, BlueBird [EMAIL PROTECTED] wrote: On Nov 21, 7:05 am, Sergio Correia [EMAIL PROTECTED] wrote: And then you do your development in python-dev. But how do you manage multiple development branches of the same program ? If you are using SVN, you may want to check out 'combinator'

Re: basic if stuff- testing ranges

2007-11-25 Thread Paddy
On Nov 25, 6:49 pm, Donn Ingle [EMAIL PROTECTED] wrote: Sheesh, I've been going spare trying to find how to do this short-hand: if 0 x 20: print within So that x must be 0 and 20. I usually do: if x 0 and x 20: print within What's the rule? Does it even exist? I read something like

better way to write this function

2007-11-25 Thread Kelie
Hello, This function does I what I want. But I'm wondering if there is an easier/better way. To be honest, I don't have a good understanding of what pythonic means yet. def divide_list(lst, n): Divide a list into a number of lists, each with n items. Extra items are ignored, if any.

[issue1468] MSI installer does not include SSL test .pem files

2007-11-25 Thread Martin v. Löwis
Martin v. Löwis added the comment: I verified the installer; this problem is now fixed. -- resolution: - fixed status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1468 __

[issue1348] httplib closes socket, then tries to read from it

2007-11-25 Thread vila
vila added the comment: The title of this bug is scary. httplib rightly close the socket because that's the way to transfer the responsibility of the close to the user of the HttpResponse object. The close MUST stays there. I do encounter a bug related to that close while trying to use the

[issue1497] Patch to remove API to create new unbound methods

2007-11-25 Thread Christian Heimes
Changes by Christian Heimes: -- components: Interpreter Core files: py3k_remove_newunbound.patch keywords: patch, py3k nosy: georg.brandl, tiran priority: high severity: normal status: open title: Patch to remove API to create new unbound methods versions: Python 3.0 Added file:

[issue1269] Exception in pstats print_callers()

2007-11-25 Thread Thomas Herve
Thomas Herve added the comment: Here's my patch against trunk, with one test. Please review! -- versions: +Python 2.6 Added file: http://bugs.python.org/file8806/1269.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1269

[issue1117670] profiler: Bad return and Bad call errors with exceptions

2007-11-25 Thread Thomas Herve
Thomas Herve added the comment: Ping to close this? -- nosy: +therve _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1117670 _ ___ Python-bugs-list mailing list

[issue1117670] profiler: Bad return and Bad call errors with exceptions

2007-11-25 Thread Georg Brandl
Georg Brandl added the comment: With pleasure. -- nosy: +georg.brandl resolution: - fixed status: open - closed _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1117670 _

[issue1734164] sqlite3 causes memory read error

2007-11-25 Thread Gerhard Häring
Gerhard Häring added the comment: Fixed in revision 59184. -- resolution: - fixed status: open - closed _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1734164 _

[issue1412] test_subprocess fails on SuSE 10

2007-11-25 Thread Christian Heimes
Christian Heimes added the comment: I've fixed a bug in py3k and 2.6 where a test in test_shutil has removed an empty TMP directory. I regard the issue as a minor inconvenience. We can't work around every edge case. -- resolution: - works for me status: open - closed

[issue1067] test_smtplib failures (caused by asyncore)

2007-11-25 Thread Skip Montanaro
Changes by Skip Montanaro: -- nosy: +skip.montanaro __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1067 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1225584] crash in gcmodule.c on python reinitialization

2007-11-25 Thread ita
ita added the comment: The following still crashes (python 2.5.1): for (int i=0; i1000; ++i) { Py_Initialize(); PyRun_SimpleString(import tarfile\n); Py_Finalize(); } Bindings such as Swig are adding weird hacks just for

[issue1381] cmath is numerically unsound

2007-11-25 Thread Mark Dickinson
Mark Dickinson added the comment: Here is (quite a large) patch, cmath.patch, that fixes a variety of problems in the current cmath module. A summary of the changes: * sqrt, log, acos, acosh, asin, asinh, atan, atanh no longer produce overflow errors for very large inputs * exp, cos, sin,

[issue1358] Compile error on OS X 10.5

2007-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: IMO it should be set to 10.4 since we want binaries that run on that platform too. Is this something we can fix in the configure script? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1358

[issue765228] Subclassing from Modules

2007-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: I don't see an issue to be fixed here; adding special tests in order to provide more detailed error messages is rarely a good idea. Also, PEP 8 has said for years now that modules should *not* be named the same as classes. Yes, there are a few such modules

[issue1496] add str.maketrans()

2007-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: Looks good from a functionality POV. I wonder if we couldn't change the dict though to always map ordinals to strings? Deletions can be mapped to . We could warn about non-string values in the 2.6 version of this code, and make it a (lazy) error in 3.0.

[issue1493] Patch to remove unbound methods

2007-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: On Nov 24, 2007 11:37 AM, Christian Heimes [EMAIL PROTECTED] wrote: Do you still believe in the tooth fairy, too? :p Yes, and in the Easter Bunny, Santa Claus, and Sinterklaas. But in this particular case I believe in Kaboutertjes. (Dutch gnomes.) And it