Re: Podcast catcher in Python

2009-09-18 Thread Chris Rebert
On Fri, Sep 18, 2009 at 7:34 PM, Chuck wrote: > I am using Python 3.1, but I can't figure out why I can't use > xml.dom.minidom.  Here is my code: > > from xml.dom.minidom import parse, parseString > url = 'http://minnesota.publicradio.org/tools/podcasts/ > grammar_grater.xml'  #just for test pur

Re: Cross platform TTF font render from Python [was: Load TTF from pycairo under Windows]

2009-09-18 Thread David Boddie
On Friday 18 September 2009 08:54, Laszlo Nagy wrote: > I need to render antialiased PNG images using TTF font files and UTF-8 > text. It needs to be available at least on Linux and Windows. This is > what I have tried: [...] > #4. pygame - documentation looks great, it is cross platform. But th

Re: Podcast catcher in Python

2009-09-18 Thread Chuck
On Sep 12, 3:37 pm, Chuck wrote: > On Sep 11, 9:54 pm, Chris Rebert wrote: > > > On Fri, Sep 11, 2009 at 7:43 PM, Chuck wrote: > > > Does anyone know how I should read/download the mp3 file, and how I > > > should write/save it so that I can play it on a media player such as > > > Windoze media

Re: Granularity of OSError

2009-09-18 Thread Grant Edwards
On 2009-09-19, Christian Heimes wrote: > kj wrote: >> For example, LBYL would look like this: >> >> if os.path.isfile(some_file): >> os.unlink(some_file) >> >> In contrast, EAFP would look like this: >> >> try: >> os.unlink(some_file) >> except OSError: >> pass > > > The two version

Re: An assessment of the Unicode standard

2009-09-18 Thread r
On Friday 18 September 2009 06:39:57 Dennis Lee Bieber wrote: (snip) Snap (sort of). Does anybody know where the concept of the purple people eater comes from? I mean is there a children's book or something? - Hendrik Where is the one eyed, one horned, lavender (antiquated) language eater i ask!

Re: Substitute for KConfig in Qt4

2009-09-18 Thread David Boddie
On Thursday 17 September 2009 13:04, nusch wrote: > I want to remove pyKDE dependencies from my app to make it pure PyQt. > What will be the best substitute for KConfig? What exactly do you use KConfig for in your application? David -- http://mail.python.org/mailman/listinfo/python-list

Re: Granularity of OSError

2009-09-18 Thread Sean DiZazzo
On Sep 18, 5:23 pm, Christian Heimes wrote: > kj wrote: > > For example, LBYL would look like this: > > > if os.path.isfile(some_file): > >     os.unlink(some_file) > > > In contrast, EAFP would look like this: > > > try: > >     os.unlink(some_file) > > except OSError: > >     pass > > The two ve

Re: Granularity of OSError

2009-09-18 Thread Christian Heimes
kj wrote: > For example, LBYL would look like this: > > if os.path.isfile(some_file): > os.unlink(some_file) > > In contrast, EAFP would look like this: > > try: > os.unlink(some_file) > except OSError: > pass The two version aren't equal. The first one suffers from a race conditio

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-18 Thread Paul Boddie
On 18 Sep, 23:17, lkcl wrote: > > the pyjamas project is taking a slightly different approach to achieve > this same goal: beat the stuffing out of the pyjamas compiler, rather > than hand-write such large sections of code in pure javascript, and > double-run regression tests (once as python, seco

Re: Granularity of OSError

2009-09-18 Thread Ryan Kelly
> > You can access the exception object which gives you greater detail. > > > > try: > > os.unlink(some_file) > > except OSError, e: > > print e.errno > > print e.strerror > > > > if e.errno == 2: > > pass > > else: > > raise > > I do this myself in a lot of plac

Re: pygame and py2app : big package

2009-09-18 Thread TerryP
On Sep 18, 9:28 pm, pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) wrote: > I used py2app on Mac to build a package of my game (using pygame). > It works fine (better than py2exe, i can'tmake work at tht time). > > But the package is very big. > The biggest "thing" is numpy lib : 19 MB !

Re: detmining name during an assignment

2009-09-18 Thread Jamie Riotto
On Fri, Sep 18, 2009 at 1:10 PM, Gabriel Genellina wrote: > En Fri, 18 Sep 2009 14:38:08 -0300, Christian Heimes > escribió: >> >> Jamie Riotto schrieb: > >>> I have an app that uses Python scripting. When a user creates a new >>> object: >>> >>> objName = newObject() >>> >>> I'd like the newObje

Re: Creating a local variable scope.

2009-09-18 Thread Sean DiZazzo
On Sep 11, 10:36 am, Johan Grönqvist wrote: > Hi All, > > I find several places in my code where I would like to have a variable > scope that is smaller than the enclosing function/class/module definition. > > One representative example would look like: > > -- > spam = { ... } > eggs = { .

Re: can python make web applications?

2009-09-18 Thread lkcl
On Sep 16, 7:02 pm, Paul Boddie wrote: > On 16 Sep, 18:31, lkcl wrote: > > > > >http://pyjs.org/examples/timesheet/output/TimeSheet.html > > I get this error dialogue message when visiting the above page: > > "TimeSheet undefined list assignment index out of range" > > Along with the following in

Re: can python make web applications?

2009-09-18 Thread lkcl
On Sep 16, 7:02 pm, Paul Boddie wrote: > On 16 Sep, 18:31, lkcl wrote: > > > > >http://pyjs.org/examples/timesheet/output/TimeSheet.html > > I get this error dialogue message when visiting the above page: > > "TimeSheet undefined list assignment index out of range" ah well spotted, thanks paul.

Re: Python based paramiko package acting up on Linux, code works fine on windows

2009-09-18 Thread flxkid
On Sep 18, 11:22 am, flxkid wrote: > I've tried to post to the mailing list for paramiko and contact the > author, but it seems he's having some mailing list problems.  Anyways, > I have this small example that works just fine on Windows against > Python 2.6.2, but fails on Ubuntu against 2.6.2.  

[ANN] pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-18 Thread lkcl
just for fits and giggles and also because i'm getting fed up of using web browsers as part of the pyjs development cycle instead of the command-line, the pyjamas pyv8run.py has been brought back up-to- scratch, and can now execute the pyjamas LibTest regression tests with a 99.95% pass rate. pyv8

Re: Why use "locals()"

2009-09-18 Thread Sean DiZazzo
On Sep 18, 9:55 am, Simon Forman wrote: > On Mon, Sep 14, 2009 at 1:12 AM, Sean DiZazzo wrote: > > > Thanks for your explanation Steven.  I see how it can be valuable, but > > it seems to always break the second rule of Zen.  I don't really want > > to get into the code of debuggers, but I guess

Re: Application-global "switches"?

2009-09-18 Thread kj
In <579a15bf-83c0-4228-9079-bbaac1222...@o13g2000vbl.googlegroups.com> Marius Gedminas writes: >On Sep 4, 9:29=A0pm, kj wrote: >> The only solution I can come up with is to define a "dummy module", >> say _config.py, which contains only upper-case variables representing >> these global switches

Re: How to print without spaces?

2009-09-18 Thread Wolfgang Rohdewald
On Friday 18 September 2009, koranthala wrote: > What if I want to print 1 to 100 in a loop without spaces in > between? I think that is the OPs question. arr = ['a', 'b', 'c', 'andsoon'] print ''.join(arr) -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a local variable scope.

2009-09-18 Thread Gabriel Genellina
En Fri, 18 Sep 2009 10:55:47 -0300, Johan Grönqvist escribió: Summarizing the answers, it seems that I will try to follow three suggestions: 1) In general, try to restructure the code into smaller modules and smaller functions. That's a good thing - "manageable" modules and functions.

Re: How to print without spaces?

2009-09-18 Thread Jerry Hill
On Fri, Sep 18, 2009 at 4:16 PM, koranthala wrote: > What if I want to print 1 to 100 in a loop without spaces in between? > I think that is the OPs question. In that case I would skip using print entirely, and use something like this: import sys for i in xrange(100): sys.stdout.write(str(i)

Re: How to print without spaces?

2009-09-18 Thread koranthala
On Sep 18, 9:49 pm, "Andreas Tawn" wrote: > > Hi, > > > I don't want to print the space between 'a' and 'b'. Could somebody > > let me know how to do it? > > > Regards, > > Peng > > > $ python > > Python 2.5.2 (r252:60911, May 21 2008, 10:08:24) > > [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux

Re: detmining name during an assignment

2009-09-18 Thread Gabriel Genellina
En Fri, 18 Sep 2009 14:38:08 -0300, Christian Heimes escribió: Jamie Riotto schrieb: I have an app that uses Python scripting. When a user creates a new object: objName = newObject() I'd like the newObject be able to use objName as its internal name. As the others already explained to

Re: How do I begin debugging a python memory leak?

2009-09-18 Thread Rainer Grimm
On Sep 18, 5:42 pm, Paul Rubin wrote: > Rainer Grimm writes: > > have a look at valgrind. > > Have you actually used that on Python? Not with python as far I can remember. But often with C++ executables, as i mentioned it. I you look at http://valgrind.org/info/ ther

Re: Not this one the other one, from a dictionary

2009-09-18 Thread Vlastimil Brom
2009/9/18 Ross : > > Learning my way around list comprehension a bit.   I wonder if someone has a > better way to solve this issue.  I have a two element dictionary, and I know > one of the keys but not the other, and I want to look up the other one. > > So I have this dictionary: > > aDict = {'a':

Re: Granularity of OSError

2009-09-18 Thread kj
In <254eac4d-ce19-4af9-8c6a-5be8e7b0f...@u16g2000pru.googlegroups.com> Sean DiZazzo writes: >On Sep 18, 11:54=A0am, kj wrote: >> I've often come across the idea that good Python style deals with >> potential errors using an EAFP ("easier to ask forgiveness than >> permission") strategy rather t

Re: Granularity of OSError

2009-09-18 Thread Jeff McNeil
On Sep 18, 3:05 pm, Sean DiZazzo wrote: > On Sep 18, 11:54 am, kj wrote: > > > > > > > I've often come across the idea that good Python style deals with > > potential errors using an EAFP ("easier to ask forgiveness than > > permission") strategy rather than a LBYL ("look before you leap") > > st

Re: How to print without spaces?

2009-09-18 Thread Tobiah
> I don't want to print the space between 'a' and 'b'. Could somebody let me > know how to do it? print "a","b" > a b Since you are new, you should also be aware of: print "%s%s" % (a, b) -- http://mail.python.org/mailman/listinfo/python-list

Re: Granularity of OSError

2009-09-18 Thread Sean DiZazzo
On Sep 18, 11:54 am, kj wrote: > I've often come across the idea that good Python style deals with > potential errors using an EAFP ("easier to ask forgiveness than > permission") strategy rather than a LBYL ("look before you leap") > strategy. > > For example, LBYL would look like this: > > if os

Re: explicit call to __init__(self) in subclass needed?

2009-09-18 Thread Andrew MacKeith
Bruno Desthuilliers wrote: Andrew MacKeith a écrit : I create a class like this in Python-2.6 >>> class Y(str): ... def __init__(self, s): ... pass ... >>> y = Y('giraffe') >>> y 'giraffe' >>> How does the base class (str) get initialized with the value passed to Y.__init__() ?

Granularity of OSError

2009-09-18 Thread kj
I've often come across the idea that good Python style deals with potential errors using an EAFP ("easier to ask forgiveness than permission") strategy rather than a LBYL ("look before you leap") strategy. For example, LBYL would look like this: if os.path.isfile(some_file): os.unlink(some

Re: Not this one the other one, from a dictionary

2009-09-18 Thread Ross
Thanks Tim (and Ishwor) for the suggestions, those are structures that somewhat new to me - looks good! I'll play with those.At this rate I may soon almost know what I'm doing. Rgds Ross. On 18-Sep-09, at 1:19 PM, Tim Chase wrote: Learning my way around list comprehension a bit. I w

Python based paramiko package acting up on Linux, code works fine on windows

2009-09-18 Thread flxkid
I've tried to post to the mailing list for paramiko and contact the author, but it seems he's having some mailing list problems. Anyways, I have this small example that works just fine on Windows against Python 2.6.2, but fails on Ubuntu against 2.6.2. Here is the code: import subprocess import

Re: How to improve this code?

2009-09-18 Thread Sergey Simonenko
elements_present = lambda seq, match: any(((x in match) for x in seq)) On Mon, 14 Sep 2009 19:08:59 -0600, Oltmans wrote: Hello, Is there someway I can improve the following code(pythonically)? (Copying from IDLE) match=[1,2,3,4,5] def elementsPresent(aList): result=False if

Re: Not this one the other one, from a dictionary

2009-09-18 Thread Ishwor
Ross Hi. > So I have this dictionary: > > aDict = {'a': 'bob', 'b': 'stu'} Yes. > I know that the dictionary contains two keys/value pairs,  but I don't know > the values nor that the keys will be 'a' and 'b'.   I finally get one of the > keys passed to me as variable BigOne. e.g.: > > BigOne =

Re: detmining name during an assignment

2009-09-18 Thread Ishwor
Jamie, Hi. > I have an app that uses Python scripting. When a user creates a new object: > > objName = newObject() newObject should technically speaking be newClass() but nevermind :-) > I'd like the newObject be able to use objName as its internal name. > So, if a user says: > > cube1 = Cube()

Re: detmining name during an assignment

2009-09-18 Thread Christian Heimes
Jamie Riotto schrieb: > I have an app that uses Python scripting. When a user creates a new object: > > objName = newObject() > > I'd like the newObject be able to use objName as its internal name. > So, if a user says: > > cube1 = Cube() > > A "cube1" object should apear in the scene list. I

Re: How to improve this code?

2009-09-18 Thread Simon Forman
On Sep 14, 9:08 pm, Oltmans wrote: > Hello, > > Is there someway I can improve the following code(pythonically)? > (Copying from IDLE) > match=[1,2,3,4,5] > > def elementsPresent(aList): >         result=False >         if not aList: >                 return False >         for e in aList: >      

Re: Not this one the other one, from a dictionary

2009-09-18 Thread Tim Chase
Learning my way around list comprehension a bit. I wonder if someone has a better way to solve this issue. I have a two element dictionary, and I know one of the keys but not the other, and I want to look up the other one. Several ways occur to me. Of the various solutions I played wit

Re: detmining name during an assignment

2009-09-18 Thread Simon Forman
On Sep 18, 1:00 pm, Jamie Riotto wrote: > I have an app that uses Python scripting. When a user creates a new object: > > objName = newObject() > > I'd like the newObject be able to use objName as its internal name. > So, if a user says: > > cube1 = Cube() > >  A "cube1" object should apear in the

Re: detmining name during an assignment

2009-09-18 Thread Stephen Hansen
On Fri, Sep 18, 2009 at 10:00 AM, Jamie Riotto wrote: > I have an app that uses Python scripting. When a user creates a new object: > > objName = newObject() > > I'd like the newObject be able to use objName as its internal name. > Almost this exact same question came up not so long ago, which is

detmining name during an assignment

2009-09-18 Thread Jamie Riotto
I have an app that uses Python scripting. When a user creates a new object: objName = newObject() I'd like the newObject be able to use objName as its internal name. So, if a user says: cube1 = Cube() A "cube1" object should apear in the scene list. I believe this means I need to determine tha

Re: multiprocessing managers and socket connection.

2009-09-18 Thread Chris
On Sep 18, 12:42 pm, "bouncy...@gmail.com" wrote: > Is this "server" something you wrote from scratch or something that is just > being used. Some details are left out > > -- > > --Original Message-- > From: Chris > To: > Date: Fri, 18 Sep 2009 09:10:15 AM -0700 > Subject: Re: m

Re: Why use "locals()"

2009-09-18 Thread Simon Forman
On Mon, Sep 14, 2009 at 1:12 AM, Sean DiZazzo wrote: > > Thanks for your explanation Steven.  I see how it can be valuable, but > it seems to always break the second rule of Zen.  I don't really want > to get into the code of debuggers, but I guess I can see how they > might have no other way to k

Re: How to print without spaces?

2009-09-18 Thread Donn
print "a"+"b" \d -- http://mail.python.org/mailman/listinfo/python-list

RE: How to print without spaces?

2009-09-18 Thread Andreas Tawn
> Hi, > > I don't want to print the space between 'a' and 'b'. Could somebody > let me know how to do it? > > Regards, > Peng > > $ python > Python 2.5.2 (r252:60911, May 21 2008, 10:08:24) > [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 > Type "help", "copyright", "credits" or "license" for

How to print without spaces?

2009-09-18 Thread Peng Yu
Hi, I don't want to print the space between 'a' and 'b'. Could somebody let me know how to do it? Regards, Peng $ python Python 2.5.2 (r252:60911, May 21 2008, 10:08:24) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> p

Re: multiprocessing managers and socket connection.

2009-09-18 Thread bouncy...@gmail.com
Is this "server" something you wrote from scratch or something that is just being used. Some details are left out -- --Original Message-- From: Chris To: Date: Fri, 18 Sep 2009 09:10:15 AM -0700 Subject: Re: multiprocessing managers and socket connection. On Aug 31, 10:41 pm,

Not this one the other one, from a dictionary

2009-09-18 Thread Ross
Learning my way around list comprehension a bit. I wonder if someone has a better way to solve this issue. I have a two element dictionary, and I know one of the keys but not the other, and I want to look up the other one. So I have this dictionary: aDict = {'a': 'bob', 'b': 'stu'} I

Re: multiprocessing managers and socket connection.

2009-09-18 Thread Chris
On Aug 31, 10:41 pm, Terry wrote: > On Aug 26, 7:25 pm, Chris wrote: > > > > > On Aug 25, 9:11 pm, Terry wrote: > > > > On Aug 25, 10:14 pm, Chris wrote: > > > > > I've been using multiprocessing managers and I really like the > > > > functionality. > > > > > I have a question about reconnectin

Re: Tkinter - Text - bullets

2009-09-18 Thread eb303
On Sep 18, 11:57 am, Thomas Lehmann wrote: > My intention is to write a small custom widget displaying text where > the text can have a simple wiki syntax. The main interest is to > support heading, bold, italic, underline, itemization and enumeration. > > How can I implement itemization using the

Re: How do I begin debugging a python memory leak?

2009-09-18 Thread Paul Rubin
Rainer Grimm writes: > have a look at valgrind. Have you actually used that on Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: OT - people eaters - was: An assessment of the Unicode standard

2009-09-18 Thread David Robinow
On Fri, Sep 18, 2009 at 3:26 AM, Hendrik van Rooyen wrote: > Does anybody know where the concept of the purple people eater comes from? > I mean is there a children's book or something? > - Hendrik http://en.wikipedia.org/wiki/Purple_People_Eater -- http://mail.python.org/mailman/listinfo/python-

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Grant Edwards
On 2009-09-18, Chris Withers wrote: > Grant Edwards wrote: >> On 2009-09-16, Alan G Isaac wrote: >> >>> Tkinter is part of the Python standard library: >> >> That doesn't mean you can depend on it being available. It >> doesn't get installed by default on some Linux distros. > > That's 'cos so

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Giacomo Boffi
Piet van Oostrum writes: >> Chris Withers (CW) wrote: > >>CW> John Nagle wrote: That's a wrapper for Antigrain ("http://www.antigrain.com/";), which is a C++ library. I'm trying hard to avoid dependencies on binary libraries with limited support. Builds exist only for P

Re: Creating a local variable scope.

2009-09-18 Thread Johan Grönqvist
Thanks for all replies. First, two general comments, and then my conclusions: I did not intend to ask for new features, but my interest was in writing readable code that works in python 2.5, although I may upgrade to 2.6 soon. Also, what I gave was intended as a minimal example, and not a com

Re: Cross platform TTF font render from Python [was: Load TTF from pycairo under Windows]

2009-09-18 Thread Robin Becker
Laszlo Nagy wrote: ... > looks impossible to use it for creating raster images. Details here: http://osdir.com/ml/python.reportlab.user/2005-06/msg00015.html OK your error occurs because we need to set up the renderPM canvas with an initial font (for compatibility with the PDF canvas

Re: Creating a local variable scope.

2009-09-18 Thread Wolfgang Rohdewald
On Friday 18 September 2009, Ethan Furman wrote: > loop != scope true for python but in some languages the loop counter has a scope limited to the loop -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: explicit call to __init__(self) in subclass needed?

2009-09-18 Thread Ethan Furman
Bruno Desthuilliers wrote: Ethan Furman a écrit : Andrew MacKeith wrote: I create a class like this in Python-2.6 >>> class Y(str): ... def __init__(self, s): ... pass ... >>> y = Y('giraffe') >>> y 'giraffe' >>> How does the base class (str) get initialized with the value passed

Re: Creating a local variable scope.

2009-09-18 Thread Ethan Furman
Neal Becker wrote: markol...@gmail.com wrote: On Sep 11, 7:36 pm, Johan Grönqvist wrote: Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. This is one of the single major frustrations

Re: Cross platform TTF font render from Python [was: Load TTF from pycairo under Windows]

2009-09-18 Thread Laszlo Nagy
... the reportlab graphics renderPM(_renderPM) module does most things with T1 and TTF and works linux/win32. We use freetype2 internally to extract the curves from ttf and then draw them with libart_lgpl which does anti-aliasing. I just tried reportlab and RenderPM. I got the same error

Re: Place the timer in Python script

2009-09-18 Thread Dave Angel
Vamsikrishna wrote: How to place the timer in python code. I want calculate the python script execution time. ex : Start Timer : End Timer Execution Time : End Timer - Start Timer. How can we write the python code for this. Help would be appreciable. Thanks in Advance. Vamsi impor

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Aaron Watters
On Sep 15, 1:25 pm, John Nagle wrote: > I'm looking for something that can draw simple bar and pie charts > in Python.  I'm trying to find a Python package, not a wrapper for > some C library, as this has to run on both Windows and Linux > and version clashes are a problem. http://skimpygimpy.sou

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Piet van Oostrum
> Chris Withers (CW) wrote: >CW> John Nagle wrote: >>> That's a wrapper for Antigrain ("http://www.antigrain.com/";), which is >>> a C++ library. I'm trying hard to avoid dependencies on binary libraries >>> with limited support. Builds exist only for Python 2.4 and 2.5. >CW> Huh? >CW> Ma

Re: class initialization problem

2009-09-18 Thread Dave Angel
rantingrick wrote: On Sep 18, 12:24 am, "OKB (not okblacke)" wrote: Perhaps you want to cut off the recursion at the first step, so that the nested instance itself does not have a nested instance. If so, add another parameter to __init__ that flags whether you are creating a "top-le

ANN: Resolver One 1.6.5 released

2009-09-18 Thread Giles Thomas
We are proud to announce the release of Resolver One, version 1.6.5. Resolver One is a Windows-based spreadsheet that integrates Python deeply into its recalculation loop, making the models you build more reliable and more maintainable. For versions 1.6 and 1.6.5, we've made it easier for people t

Re: Creating a local variable scope.

2009-09-18 Thread Neal Becker
markol...@gmail.com wrote: > On Sep 11, 7:36 pm, Johan Grönqvist wrote: >> Hi All, >> >> I find several places in my code where I would like to have a variable >> scope that is smaller than the enclosing function/class/module >> definition. > > This is one of the single major frustrations I have

python-win32 : cross database automation

2009-09-18 Thread Threader Slash
Hello Everybody... I working on a client-server database solution. The system is normalized and is using MySQL. To automate some of processes I using Python. Part of the old database will be still running on Lotus Notes. After working on it, it seems that the best choice to directly manipulate Lo

Re: How do I begin debugging a python memory leak?

2009-09-18 Thread Rainer Grimm
On 17 Sep., 02:10, Matthew Wilson wrote: > I have a web app based on TurboGears 1.0.  In the last few days, as > traffic and usage has picked up, I noticed that the app went from using > 4% of my total memory all the way up to 50%. > > I suspect I'm loading data from the database and somehow preve

Re: specify max width to reportlab.canvas.drawString

2009-09-18 Thread Robin Becker
juanefren wrote: I am using reportlab to create pdf documents, everything looks fine, how ever, is there a way to specify a max width to drawString function ? I mean cut the sentence and continue a step down... Cheers You'll get better results asking at the reportlab user group reportlab-u

Re: Place the timer in Python script

2009-09-18 Thread Avell Diroll
Vamsikrishna wrote: How to place the timer in python code. timeit ... it's in the standard library: http://docs.python.org/library/timeit.html Cheers, Ju -- Whomever controls the press, owns history -- Johann Gutenberg -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross platform TTF font render from Python [was: Load TTF from pycairo under Windows]

2009-09-18 Thread Robin Becker
Laszlo Nagy wrote: Hi All, I need to render antialiased PNG images using TTF font files and UTF-8 text. It needs to be available at least on Linux and Windows. This is what I have tried: #1. PIL - it has some problems and I cannot use it. Specifically, the ImageFont.getsize() returns bad va

Tkinter - Text - bullets

2009-09-18 Thread Thomas Lehmann
My intention is to write a small custom widget displaying text where the text can have a simple wiki syntax. The main interest is to support heading, bold, italic, underline, itemization and enumeration. How can I implement itemization using the Tkinter.Text widget? (bullets) -- http://mail.pytho

Place the timer in Python script

2009-09-18 Thread Vamsikrishna
How to place the timer in python code. I want calculate the python script execution time. ex : Start Timer : End Timer Execution Time : End Timer - Start Timer. How can we write the python code for this. Help would be appreciable. Thanks in Advance. Vamsi -- http://mail.python.org/mailm

Re: Creating a local variable scope.

2009-09-18 Thread markol...@gmail.com
On Sep 11, 7:36 pm, Johan Grönqvist wrote: > Hi All, > > I find several places in my code where I would like to have a variable > scope that is smaller than the enclosing function/class/module definition. This is one of the single major frustrations I have with Python and a important source of bu

Re: How do I begin debugging a python memory leak?

2009-09-18 Thread Chris Withers
Matthew Wilson wrote: I have a web app based on TurboGears 1.0. In the last few days, as traffic and usage has picked up, I noticed that the app went from using 4% of my total memory all the way up to 50%. I suspect I'm loading data from the database and somehow preventing garbage collection.

Cross platform TTF font render from Python [was: Load TTF from pycairo under Windows]

2009-09-18 Thread Laszlo Nagy
Hi All, I need to render antialiased PNG images using TTF font files and UTF-8 text. It needs to be available at least on Linux and Windows. This is what I have tried: #1. PIL - it has some problems and I cannot use it. Specifically, the ImageFont.getsize() returns bad value for some fonts,

Re: recommendation for webapp testing?

2009-09-18 Thread Chris Withers
Simon Brunning wrote: Mechanize is a superb library for its intended purpose - I use it all the time. It's lack of support for pages with JavaScript functionality, though, means it's not very useful at a testing tool for modern web sites. There's also zope.testbrowser, which is a handy wrapper

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Chris Withers
Grant Edwards wrote: On 2009-09-16, Alan G Isaac wrote: Tkinter is part of the Python standard library: That doesn't mean you can depend on it being available. It doesn't get installed by default on some Linux distros. That's 'cos some linux distros feel the need to destroy python's pack

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Chris Withers
John Nagle wrote: That's a wrapper for Antigrain ("http://www.antigrain.com/";), which is a C++ library. I'm trying hard to avoid dependencies on binary libraries with limited support. Builds exist only for Python 2.4 and 2.5. Huh? Matplotlib is a pretty phenomenal charting library, I use

Re: explicit call to __init__(self) in subclass needed?

2009-09-18 Thread Bruno Desthuilliers
Andrew MacKeith a écrit : I create a class like this in Python-2.6 >>> class Y(str): ... def __init__(self, s): ... pass ... >>> y = Y('giraffe') >>> y 'giraffe' >>> How does the base class (str) get initialized with the value passed to Y.__init__() ? It happens in the __new__ met

Re: SQLite or files?

2009-09-18 Thread Tim Chase
You can also make a SQLite database be in-memory, giving you the performance benefits of skipping the disk. Yes, I love the in-memory database -- especially for my automated testing in Django. However, the OP said that memory footprint was a concern (granted, I don't know how much data they

specify max width to reportlab.canvas.drawString

2009-09-18 Thread juanefren
I am using reportlab to create pdf documents, everything looks fine, how ever, is there a way to specify a max width to drawString function ? I mean cut the sentence and continue a step down... Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: explicit call to __init__(self) in subclass needed?

2009-09-18 Thread Bruno Desthuilliers
Ethan Furman a écrit : Andrew MacKeith wrote: I create a class like this in Python-2.6 >>> class Y(str): ... def __init__(self, s): ... pass ... >>> y = Y('giraffe') >>> y 'giraffe' >>> How does the base class (str) get initialized with the value passed to Y.__init__() ? Is this

Re:OT - people eaters - was: An assessment of the Unicode standard

2009-09-18 Thread Hendrik van Rooyen
On Friday 18 September 2009 06:39:57 Dennis Lee Bieber wrote: > A one-eyed, one-horned, flying purple people eater? > > {Which brings up the confusing question... Is the eater purple, or does > it eat purple people (which is why it is so rare... it only eats people > caught in the last stage

Re: An assessment of the Unicode standard

2009-09-18 Thread Hendrik van Rooyen
On Thursday 17 September 2009 15:29:38 Tim Rowe wrote: > There are good reasons for it falling out of favour, though. At the > time of the Sapir-Whorf hypothesis, anthropologists were arguing that > members of a certain remote tribe did not experience grief on the > death of a child because their