Re: str(int_var) formatted

2010-10-30 Thread Tracubik
Il Fri, 29 Oct 2010 19:18:41 -0700, John Yeung ha scritto: > On Oct 29, 11:59 am, Tracubik wrote: >> i've to convert integer x to string, but if x < 10, the string have to >> be '0x' instead of simple 'x' >> >> for example: >> >> x = 9 >> str(x) --> '09' > > Everyone else seems to prefer the for

Re: functions, list, default parameters

2010-10-30 Thread Steven D'Aprano
On Sat, 30 Oct 2010 19:31:53 +1300, Gregory Ewing wrote: > Steven D'Aprano wrote: > >> And how does Python know whether some arbitrary default object is >> mutable or not? > > It doesn't, that's the whole point. I think we're in violent agreement :) -- Steven -- http://mail.python.org/mail

Re: embarrassing class question

2010-10-30 Thread Steven D'Aprano
On Sat, 30 Oct 2010 19:30:21 +1300, Gregory Ewing wrote: > (BTW, there are no function names that have a special meaning in a > module dict -- a module is not like a class.) Pity... it would be nice to have a __main__() function, or perhaps main(), that was automatically called when you call the

Re: multiprocessing signal defect

2010-10-30 Thread Adam Skutt
On Oct 29, 10:08 am, Adam Tauno Williams wrote: > No, I don't think so.  You're asking the module to over generalize > behavior.  Reaping of the child is important, and that the child needs > to be reaped may matter to the master child (why? did something go > wrong?). And such information is made

Using PHP to Dynamically Compress CSS and JavaScript ...

2010-10-30 Thread neha shena
Using PHP to Dynamically Compress CSS and JavaScript ... CSS and JavaScript files are simple plain text files with large amounts of unused space. Compressing all your style sheets into one page ... read more > http://childschooledu.blogspot.com/ -- http://mail.python.org/mailman/listinfo/py

Re: Python changes

2010-10-30 Thread Steve Holden
On 10/28/2010 2:14 PM, Craig McRoberts wrote: > First off, greetings from a newbie! > > Here's the deal. I gained a passable knowledge of Python nearly ten > years ago. Then I decided a career in the computer sciences wasn't > for me, and I let it go. Now I find myself back in the development > ar

Re: How on Factorial

2010-10-30 Thread Wolfram Hinderer
On 27 Okt., 10:27, Arnaud Delobelle wrote: > True.  It's far too verbose.  I'd go for something like: > >     f=lambda n:n<=0 or n*f(~-n) > > I've saved a few precious keystrokes and used the very handy ~- idiom! You can replace "n<=0" with "n<1". Then you can leave out the space before "or" ("0o

[ANN] Pyspread 0.1.2 released

2010-10-30 Thread Martin Manns
Pyspread 0.1.2 released === I am pleased to announce the new release 0.1.2 of pyspread. About: -- Pyspread is a cross-platform Python spreadsheet application. It is based on and written in the programming language Python. Instead of spreadsheet formulas, Python expr

Tkinter Scrollbar bad behavior [re. bug #10232]

2010-10-30 Thread Robert A. Lerche
I am trying to use Tkinter to create a custom scrollable widget, similar to a list box but with 3 Entry fields per row. In the real application each Entry has a separate input validation routine. I have placed a test case file in the bug I reported: http://bugs.python.org/issue10232 The most ser

Re: [OFF] sed equivalent of something easy in python

2010-10-30 Thread Mark Wooding
Jussi Piitulainen writes: > Daniel Fetchinson writes: > > > The pattern is that the first line is deleted, then 2 lines are > > kept, 3 lines are deleted, 2 lines are kept, 3 lines are deleted, > > etc, etc. > > So, is there some simple expression in Python for this? (item for i, item in enumera

Re: Generating PDF file in Python

2010-10-30 Thread David Boddie
On Saturday 30 October 2010 04:27, Lawrence D'Oliveiro wrote: > In message , Ed Keith > wrote: > >> I need to generate PDF files and I'm exploring what tools to use. I was >> planing on using ReportLab, but recently found some references to pango >> (http://www.pango.org/) and ciaro (http://cairo

Re: curses and processing terminal escape characters

2010-10-30 Thread Tim Harig
On 2010-10-30, Lawrence D'Oliveiro wrote: > In message , Tim Harig wrote: > >> Python could easily process the escape codes for any given terminal; but, >> in general, you would want something that works for more then a single >> terminal type. > > Does anyone still bother with anything other than

Re: curses and processing terminal escape characters

2010-10-30 Thread Emile van Sebille
On 10/29/2010 9:48 PM Lawrence D'Oliveiro said... In message, Tim Harig wrote: Python could easily process the escape codes for any given terminal; but, in general, you would want something that works for more then a single terminal type. Does anyone still bother with anything other than VT1x

Re: Tkinter Scrollbar bad behavior [re. bug #10232]

2010-10-30 Thread rantingrick
Robert, First and foremost if you wish to scroll a window then why not use the TIX.ScrolledWindow widget instead. It even shows and hides the scrollbar when necessary. #-- Start Script --# from Tix import * #from Tkconstants import * class App(Tk): # Must use Tk for Tix incompability def __

Re: Python 2.7 or 3.1

2010-10-30 Thread Lawrence D'Oliveiro
In message , Christian Heimes wrote: > Am 29.10.2010 23:16, schrieb Lawrence D'Oliveiro: > >> In message , Jorge >> Biquez wrote: >> >>> I was wondering if you can comment more about what alternatives to >>> use instead to MySql. My web solutions do not need "all the power" of >>> a true databas

Re: Python 2.7 or 3.1

2010-10-30 Thread bradenf
I agree +1 Sent wirelessly from my BlackBerry. -Original Message- From: Lawrence D'Oliveiro Sender: python-list-bounces+bradenf=hotmail@python.org Date: Sun, 31 Oct 2010 13:30:38 To: Subject: Re: Python 2.7 or 3.1 In message , Christian Heimes wrote: > Am 29.10.2010 23:16, schrie

Re: factorial of negative one (-1)

2010-10-30 Thread Robert Kern
On 2010-10-30 00:29 , Bj Raz wrote: Thank you Robert for the clarification. Since I'm an amateur programmer, could you please give me a sample of how I would do it. Chris Rebert just showed you. I'll take some time to study arrays as well, and how to write them, I know of lists, and tuples,

How to write pbm file in Python 3?

2010-10-30 Thread André
I'm trying to create pbm (portable bitmap) files using Python 3 and have run into a problem. The example I am using is the Python 2 Mandelbrot program found at http://shootout.alioth.debian.org/u32/program.php?test=mandelbrot&lang=python&id=1 When I run it using Python 2 with size=100, I get a f

Re: How to write pbm file in Python 3?

2010-10-30 Thread bradenf
Sorry for the newb question but, what would this be for? Just out of curiousuty Thanks --Original Message-- From: André Sender: python-list-bounces+bradenf=hotmail@python.org To: Python List Subject: How to write pbm file in Python 3? Sent: Oct 30, 2010 11:32 PM I'm trying to creat

Re: How to write pbm file in Python 3?

2010-10-30 Thread Chris Rebert
On Sat, Oct 30, 2010 at 8:32 PM, André wrote: > I'm trying to create pbm (portable bitmap) files using Python 3 and > have run into a problem.   The example I am using is the Python 2 > Mandelbrot program found at > http://shootout.alioth.debian.org/u32/program.php?test=mandelbrot&lang=python&id=1

Re: How to write pbm file in Python 3?

2010-10-30 Thread André
On Oct 31, 1:11 am, Chris Rebert wrote: > On Sat, Oct 30, 2010 at 8:32 PM, André wrote: > > I'm trying to create pbm (portable bitmap) files using Python 3 and > > have run into a problem.   The example I am using is the Python 2 > > Mandelbrot program found at > >http://shootout.alioth.debian.or

Re: How to write pbm file in Python 3?

2010-10-30 Thread Chris Rebert
On Sat, Oct 30, 2010 at 9:21 PM, André wrote: > On Oct 31, 1:11 am, Chris Rebert wrote: >> On Sat, Oct 30, 2010 at 8:32 PM, André wrote: >> > I'm trying to create pbm (portable bitmap) files using Python 3 and >> > have run into a problem.   The example I am using is the Python 2 >> > Mandelbrot

Re: How to write pbm file in Python 3?

2010-10-30 Thread Andre Roberge
On Sun, Oct 31, 2010 at 1:32 AM, Chris Rebert wrote: > On Sat, Oct 30, 2010 at 9:21 PM, André wrote: > > On Oct 31, 1:11 am, Chris Rebert wrote: > >> On Sat, Oct 30, 2010 at 8:32 PM, André wrote: > >> > I'm trying to create pbm (portable bitmap) files using Python 3 and > >> > have run into a

Is there a way to pring a list object in Python?

2010-10-30 Thread Zeynel
class Rep(db.Model): author = db.UserProperty() replist = db.ListProperty(str) unique = db.ListProperty(str) date = db.DateTimeProperty(auto_now_add=True) Rep().replist = L Rep().put() mylist = Rep().all().fetch(10) I am trying to display mylist; but I am getting the object.