Re: class initialization problem

2009-09-18 Thread rantingrick
EDIT: copy.copy did work in a simple python interactive session, but it caused infinite recursion in my real world code? Anyway what ever is going on (probably lack of sleep!) the cure all was using an arg in the initial function. So now i am good as gold ;-) WHY did i need do this you may ask?

Python history animation with code_swarm

2009-09-18 Thread Ulrich Eckhardt
Hi! Take a look at: http://vis.cs.ucdavis.edu/~ogawa/codeswarm/ code_swarm is a tool that generates a nice visual animation from a repository history. It also features one with the Python history for download, enhanced with a few comments. I hope this isn't old news and you enjoy it! Uli

Re: SQLite or files?

2009-09-18 Thread TerryP
alex23 wrote: So what part of the standard library do you recommend using instead? Or was there no time for advice between snarkiness? As a matter of technique, I believe in fitting the storage to the particulars of the problem at hand. In my own projects, I will often employ simple text based

Re: class initialization problem

2009-09-18 Thread Gabriel Genellina
En Fri, 18 Sep 2009 03:12:46 -0300, rantingrick rantingr...@gmail.com escribió: I am creating geometry with OpenGL. When you create a face you must specify a winding order (clockwise or counter clockwise) this winding order controls which side of the face will be visible (since only one side

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

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 stages of

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 behavior

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

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__ method (which

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: Looking for a pure Python chart drawing module

2009-09-18 Thread Chris Withers
Grant Edwards wrote: On 2009-09-16, Alan G Isaac alan.is...@gmail.com 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

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

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

Re: Creating a local variable scope.

2009-09-18 Thread markol...@gmail.com
On Sep 11, 7:36 pm, Johan Grönqvist johan.gronqv...@gmail.com 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

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

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

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

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

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

2009-09-18 Thread Rainer Grimm
On 17 Sep., 02:10, Matthew Wilson m...@tplus1.com 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

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

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 johan.gronqv...@gmail.com 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

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

Re: class initialization problem

2009-09-18 Thread Dave Angel
rantingrick wrote: On Sep 18, 12:24 am, OKB (not okblacke) brennospamb...@nobrenspambarn.net 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

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Piet van Oostrum
Chris Withers ch...@simplistix.co.uk (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

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Aaron Watters
On Sep 15, 1:25 pm, John Nagle na...@animats.com 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.

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

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: 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 johan.gronqv...@gmail.com 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

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 to

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

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Giacomo Boffi
Piet van Oostrum p...@cs.uu.nl writes: Chris Withers ch...@simplistix.co.uk (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

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

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Grant Edwards
On 2009-09-18, Chris Withers ch...@simplistix.co.uk wrote: Grant Edwards wrote: On 2009-09-16, Alan G Isaac alan.is...@gmail.com 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

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 hend...@microcorp.co.za 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 --

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

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

Re: Tkinter - Text - bullets

2009-09-18 Thread eb303
On Sep 18, 11:57 am, Thomas Lehmann iris-und-thomas-lehm...@t- Online.de 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

Re: multiprocessing managers and socket connection.

2009-09-18 Thread Chris
On Aug 31, 10:41 pm, Terry terry.yin...@gmail.com wrote: On Aug 26, 7:25 pm, Chris chris...@gmail.com wrote: On Aug 25, 9:11 pm, Terry terry.yin...@gmail.com wrote: On Aug 25, 10:14 pm, Chris chris...@gmail.com wrote: I've been using multiprocessing managers and I really like the

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'}

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 chris...@gmail.com To: python-list@python.org Date: Fri, 18 Sep 2009 09:10:15 AM -0700 Subject: Re: multiprocessing managers and

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. print a,b a

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 more information.

Re: How to print without spaces?

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

Re: Why use locals()

2009-09-18 Thread Simon Forman
On Mon, Sep 14, 2009 at 1:12 AM, Sean DiZazzo half.ital...@gmail.com 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

Re: multiprocessing managers and socket connection.

2009-09-18 Thread Chris
On Sep 18, 12:42 pm, bouncy...@gmail.com 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 chris...@gmail.com To: python-l...@python.org Date: Fri,

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 that

Re: detmining name during an assignment

2009-09-18 Thread Stephen Hansen
On Fri, Sep 18, 2009 at 10:00 AM, Jamie Riotto jamie.rio...@gmail.comwrote: 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

Re: detmining name during an assignment

2009-09-18 Thread Simon Forman
On Sep 18, 1:00 pm, Jamie Riotto jamie.rio...@gmail.com 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

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

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 believe

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()  A

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 = a

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 rolf.oltm...@gmail.com wrote: Hello, Is there someway I can improve the following code(pythonically)? (Copying from IDLE) match=[1,2,3,4,5] def elementsPresent(aList):

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

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

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__() ? It happens

Re: Granularity of OSError

2009-09-18 Thread Sean DiZazzo
On Sep 18, 11:54 am, kj no.em...@please.post 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

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 Jeff McNeil
On Sep 18, 3:05 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Sep 18, 11:54 am, kj no.em...@please.post 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

Re: Granularity of OSError

2009-09-18 Thread kj
In 254eac4d-ce19-4af9-8c6a-5be8e7b0f...@u16g2000pru.googlegroups.com Sean DiZazzo half.ital...@gmail.com writes: On Sep 18, 11:54=A0am, kj no.em...@please.post wrote: I've often come across the idea that good Python style deals with potential errors using an EAFP (easier to ask forgiveness

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

2009-09-18 Thread Vlastimil Brom
2009/9/18 Ross ros...@gmail.com: 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:

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

2009-09-18 Thread Rainer Grimm
On Sep 18, 5:42 pm, Paul Rubin http://phr...@nospam.invalid wrote: Rainer Grimm r.gr...@science-computing.de 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

Re: detmining name during an assignment

2009-09-18 Thread Gabriel Genellina
En Fri, 18 Sep 2009 14:38:08 -0300, Christian Heimes li...@cheimes.de 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

Re: How to print without spaces?

2009-09-18 Thread koranthala
On Sep 18, 9:49 pm, Andreas Tawn andreas.t...@ubisoft.com 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

Re: How to print without spaces?

2009-09-18 Thread Jerry Hill
On Fri, Sep 18, 2009 at 4:16 PM, koranthala koranth...@gmail.com 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):

Re: Creating a local variable scope.

2009-09-18 Thread Gabriel Genellina
En Fri, 18 Sep 2009 10:55:47 -0300, Johan Grönqvist johan.gronqv...@gmail.com 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

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: Application-global switches?

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

Re: Why use locals()

2009-09-18 Thread Sean DiZazzo
On Sep 18, 9:55 am, Simon Forman sajmik...@gmail.com wrote: On Mon, Sep 14, 2009 at 1:12 AM, Sean DiZazzo half.ital...@gmail.com 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

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

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 theflx...@gmail.com 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

Re: can python make web applications?

2009-09-18 Thread lkcl
On Sep 16, 7:02 pm, Paul Boddie p...@boddie.org.uk wrote: On 16 Sep, 18:31, lkcl luke.leigh...@googlemail.com 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

Re: can python make web applications?

2009-09-18 Thread lkcl
On Sep 16, 7:02 pm, Paul Boddie p...@boddie.org.uk wrote: On 16 Sep, 18:31, lkcl luke.leigh...@googlemail.com 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

Re: Creating a local variable scope.

2009-09-18 Thread Sean DiZazzo
On Sep 11, 10:36 am, Johan Grönqvist johan.gronqv...@gmail.com 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 = {

Re: detmining name during an assignment

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

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: 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 places, almost exactly like

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

2009-09-18 Thread Paul Boddie
On 18 Sep, 23:17, lkcl luke.leigh...@googlemail.com 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

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 condition which

Re: Granularity of OSError

2009-09-18 Thread Sean DiZazzo
On Sep 18, 5:23 pm, Christian Heimes li...@cheimes.de 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: 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: 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: Granularity of OSError

2009-09-18 Thread Grant Edwards
On 2009-09-19, Christian Heimes li...@cheimes.de 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 aren't

Re: Podcast catcher in Python

2009-09-18 Thread Chuck
On Sep 12, 3:37 pm, Chuck galois...@gmail.com wrote: On Sep 11, 9:54 pm, Chris Rebert c...@rebertia.com wrote: On Fri, Sep 11, 2009 at 7:43 PM, Chuck galois...@gmail.com 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

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 the

Re: Podcast catcher in Python

2009-09-18 Thread Chris Rebert
On Fri, Sep 18, 2009 at 7:34 PM, Chuck galois...@gmail.com wrote: snip 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'  

[issue6925] Doc for locals and vars

2009-09-18 Thread Senthil
Senthil orsent...@gmail.com added the comment: On Fri, Sep 18, 2009 at 04:35:37AM +, Terry J. Reedy wrote: Was 2.x different? Even in 2.x it returns {} And I thought that was expected. Even I am confused by the free variable explaination as you pointed out. Perhaps, Georg could explain

[issue6919] Link CRT Statically

2009-09-18 Thread Henri Hein
Henri Hein he...@granitetower.net added the comment: Right, I was thinking about rebuilding Python26.dll. If we do go down that path, I will report the results. Thanks for the feedback. -- ___ Python tracker rep...@bugs.python.org

[issue6937] multiprocessing lock on OS X Snow Leopard dumps core

2009-09-18 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Jesse: is this something you can look into? This is a crash of multiprocessing on MacOSX 10.6 with a 64-bit build of python. -- assignee: ronaldoussoren - jnoller nosy: +jnoller ___ Python

[issue6934] [PATCH] postflight.framework script (from the Mac OS X .dmg installer) fails.

2009-09-18 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Thanks. I'll fix this over the weekend. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6934 ___

[issue6767] Python as zip package

2009-09-18 Thread Senthil
Senthil orsent...@gmail.com added the comment: I think it is okay to close this, with Martin's Howto. -- nosy: +orsenthil resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6767

[issue6925] Doc for locals and vars

2009-09-18 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I'm sorry, I messed up the test. When x is not used in g(), it's of course *not* a free variable in g. This is the correct test: def f(): x = 1 def g(): print x print locals() g() f() --

[issue6936] Import needed to quit Python?

2009-09-18 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: They are meant for interactive use only. -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6936

[issue6936] Import needed to quit Python?

2009-09-18 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: And fixed now (I used ``quit()``) in r74896. -- resolution: works for me - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6936 ___

[issue6935] Version updates needed in tutorial

2009-09-18 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Fixed in r74897, r74898 (3.1). -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6935 ___

[issue6508] expose setresuid

2009-09-18 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Your patch looks good (except that in getresuid, you seem to be missing return). I have no clue why it doesn't work; I'll see whether I can try it out on Linux within the next few weeks. The one puzzling detail is that you don't include a

  1   2   >