Re: Tkinter add_cascade option_add

2005-09-15 Thread Eric Brunel
On Wed, 14 Sep 2005 09:58:25 -0600, Bob Greschke <[EMAIL PROTECTED]> wrote: > "Eric Brunel" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Tue, 13 Sep 2005 22:31:31 -0600, Bob Greschke <[EMAIL PROTECTED]> wrote: >> >>> Root.option_add("*?*font", "Helvetica 12 bold") >>> >>>

Pythonutils 0.2.2 , ConfigObj 4.0.0 Beta 5, odict 0.1.1

2005-09-15 Thread Fuzzyman
The response to pythonutils__ was very good. Especially the odict__ module (ordered dictionary) - it's had over one hundred and fifty downloads already. Thanks to some useful user feedback, Nicola Larosa has updated and improved it. More embarassingly we've done a bugfix release of ConfigObj__ - n

new in python

2005-09-15 Thread blackfox505
hello everyone : I'm new in python and I would like to know what is the capabilleties of this language.Please let me know and how I can make a program in python exe thanks alot -- http://mail.python.org/mailman/listinfo/python-list

Python in C integration and WxPython

2005-09-15 Thread Alain Paschoud
Hi all, I made a small dialog in WxPython. I can run the python script with a double-click or through command line, and everything goes fine (dialog appears, which means that wx module has been found). Then, I decided to write a C program (under Windows, with Cygwin) that will read my script (thro

Re: some advice about Python GUI apps

2005-09-15 Thread malv
Hi Kris, I used several GUI's, also wx. You should look at eric3, it's by far the best of all. http://www.die-offenbachs.de/detlev/eric3.html Eric3 uses Qt. Qt is also great with C++. I ported a major Python project from Windows to Linux under Python-Qt and encountered no problem whatsoever. I use

Re: Software bugs aren't inevitable

2005-09-15 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > As I write, the main article starts here: > http://www.spectrum.ieee.org/sep05/2164 > With the sidebar here: > http://www.spectrum.ieee.org/sep05/2164/extsb1 Thanks, the article is slightly interesting but it doesn't say much. I'm sure a lot more is going

Re: new in python

2005-09-15 Thread Fredrik Lundh
"blackfox505" <[EMAIL PROTECTED]> wrote: > I'm new in python and I would like to know what is the capabilleties > of this language.Please let me know and how I can make a program in > python exe if you want to know how to make programs in python, start here: http://wiki.python.org/moin/Begin

Re: p2exe using wine/cxoffice

2005-09-15 Thread Tim Roberts
James Stroud <[EMAIL PROTECTED]> wrote: > >My department has switched from vmware to wine/cxoffice. Fascinating. If you don't mind, and if others don't mind an off-topic diversion, can you spend a few minutes explaining what led to this decision? Wine is pretty good, but it will never be as thor

Re: "optimizing out" getattr

2005-09-15 Thread Peter Otten
Daishi Harada wrote: > I'd like to get the 'get2' function below to > perform like the 'get1' function (I've included > timeit.py results). > labels = ('a', 'b') > def get1(x): > return (x.a, x.b) > def mkget(attrs): > def getter(x): > return tuple(getattr(x, label) for label in

Re: ddd or eclipse with mod_python

2005-09-15 Thread bruno modulix
Sakcee wrote: > Hi > > I am using mod_python for web development, I am in need of some ide , > can i use ddd or eclipse with pydev with mod_python. Don't know, but you may want to check Eric3, a full blown Python IDE with support for mod_python debugging. -- bruno desthuilliers python -c "prin

Re: urllib.open problem

2005-09-15 Thread Fredrik Lundh
Astan Chee wrote: > I have a python script which runs perfectly on my machine. > However a machine that I tested it on gives the following error > message: > > Traceback (most recent call last): > File "whip.py", line 616, in OnRebootRunning > File "whip.py", line 626, in R

Re: working with VERY large 'float' and 'complex' types

2005-09-15 Thread Mikael Olofsson
Paul Rubin calculates exp(1000.0): > You could rearrange your formulas to not need such big numbers: > > x = 1000. > log10_z = x / math.log(10) > c,m = divmod(log10_z, 1.) > print 'z = %.5fE%d' % (10.**c, m) Nice approach. We should never forget that we do have mathematical skill

wxPython and window sizing

2005-09-15 Thread Ville Voipio
I have a small problem; I would like to have a reasonable minimum size for a wx.Window. A simplified version of my code: s = wx.SplitterWindow(self, -1) curves = wx.Notebook(s) curve = wx.Window(curves, ID_BLANKCURVE, style=wx.SUNKEN_BORDER, siz

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError oninteractive sessions?

2005-09-15 Thread Steve Holden
Lonnie Princehouse wrote: > After doing some more reading, I now think this isn't a bug. > > Evidently the unbuffered flag not only makes stdin unbuffered, but it > also forces it into binary mode. I didn't realize that when I posted > earlier. > > So the SyntaxErrors arise because the interpret

change an element of a list

2005-09-15 Thread Dirk Hagemann
Hi! I have a list of lists and in some of these lists are elements which I want to change. Here an example: lists=[('abc', 4102, 3572), ('def', 2707, 'None'), ('ghi', 'None', 4102)] 'None' should be replaced by 0 or NULL or something else. But as far as I know the replace function of the modu

Re: Software bugs aren't inevitable

2005-09-15 Thread Jerzy Karczmarczuk
Steven D'Aprano is still unhappy with the linear complexity recursive Fibonacci I proposed as as an alternative to the cascading recursion which for some people is "standard" or "obvious" or other similar attribution which is not valid anymore. > RuntimeError: maximum recursion depth exceeded >

Re: global interpreter lock

2005-09-15 Thread Michael Sparks
Stephen Thorne wrote: > On 15/09/05, Michael Sparks <[EMAIL PROTECTED]> wrote: >> At the moment, one option that springs to mind is this: >> yield WaitDataAvailable("inbox") > > Twisted supports this. > > help("twisted.internet.defer.waitForDeferred") Thanks for this. I'll take a look and e

Re: Newbie - instanciating classes from other files

2005-09-15 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Hey guys, i just started learning python (i usually use java/C). > > this has got me stumped as its not mentioned in the documentation > (unless im skimming it every time). > > How does one instanciate a class from another file > > i thought it would be > -

Re: change an element of a list

2005-09-15 Thread bruno modulix
Dirk Hagemann wrote: > Hi! > > I have a list of lists and in some of these lists are elements which I > want to change. > Here an example: > lists=[('abc', 4102, 3572), ('def', 2707, 'None'), ('ghi', 'None', 4102)] > > 'None' should be replaced by 0 or NULL or something else. Your list is a

Re: Create and display an email

2005-09-15 Thread Will McGugan
Adam Endicott wrote: > I've got a wxPython based windows GUI application that takes some input > and creates a PDF file output. At the end, I need to create an email > message with this pdf file attached ready for the user to just hit > "send". I don't want to actually send the email automatically,

Python CSV writer confusion.

2005-09-15 Thread googleboy
Hi. I am trying to write out a csv file with | instead of comma, because I have a field that may have many commas in it. I read in a csv file, sort it, and want to write it out again. I read the example that says: import csv writer = csv.writer(open("some.csv", "wb")) writer.writerows(someiter

Re: change an element of a list

2005-09-15 Thread Dirk Hagemann
THANKS! That works :-) But meanwhile I found another solution that works in my case. Out of this list of tuples I generated a SQL-Statement which is a simple string. Then I simply checked this string for 'None'. May be too easy... Dirk -- http://mail.python.org/mailman/listinfo/python-list

Re: round() wrong in Python 2.4?

2005-09-15 Thread Antoon Pardon
Op 2005-09-14, Robert Kern schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-09-13, Robert Kern schreef <[EMAIL PROTECTED]>: >> >>>Jeremy Sanders wrote: >>> Nils Grimsmo wrote: >Why did round() change in Python 2.4? It the usual floating point representation prob

Re: change an element of a list

2005-09-15 Thread bruno modulix
Dirk Hagemann wrote: > THANKS! That works :-) Of course it works. Why wouldn'it it work ?-) > But meanwhile I found another solution that works in my case. Out of > this list of tuples I generated a SQL-Statement which is a simple > string. Then I simply checked this string for 'None'. May be too

re and escape character

2005-09-15 Thread Sinan Nalkaya
i re-format incoming messages like this, command = re.findall("^\002(.{2})\|.*\003$", response)[0] it works well but when response comes with escape characters , my command variable crashes, i cannot parse if response variable is like , response = '\002AB|TIasdasdasd asdasdasd xzczxc qwewer werwer

Re: Software bugs aren't inevitable

2005-09-15 Thread Steven D'Aprano
On Wed, 14 Sep 2005 12:23:00 -0700, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> It is a "mere implementation detail" that (for most computer systems, and >> most programming languages) stack space is at a premium and a deeply >> recursive function can run out of stack space

Re: Oblique Strategies

2005-09-15 Thread Tom Anderson
On Wed, 14 Sep 2005, robin wrote: > The Oblique Strategies were originally a set of one-hundred cards, each > bearing a short phrase. They were devised by Brian Eno and Peter Schmidt > as ways of working through creative problems. When a blockage occurs, > draw a card, and see if it can direct

Oh Yes, They Are [was: Re: Software bugs aren't inevitable]

2005-09-15 Thread Steve Holden
Paddy wrote: > A work colleague circulated this interesting article about reducing > software bugs by orders of magnitude: > http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html > > Some methods they talk about include removing error prone and ambiguous > expressions from their

Re: What XML lib to use?

2005-09-15 Thread Paul Boddie
Fredrik Lundh wrote: > Robert Kern wrote: > > His interpretation of your words is a perfectly valid one even in the > > context of this thread. "in Python" explicitly provides a context for > > the rest of the sentence. > > Exactly. "in Python", not "in an application with an existing API". Well,

Re: Software bugs aren't inevitable

2005-09-15 Thread Carl Friedrich Bolz
Hi! 2005/9/15, Jerzy Karczmarczuk <[EMAIL PROTECTED]>: [snip] > But, I have used myself the cascading version. It was done on purpose, in > order to get to the following solution. > [[I preferred to use a global dict, but other ways of doing it are also > possible]]. > > fibdic={0:0,1:1} > def

Britney Spears nude

2005-09-15 Thread john basha
send me the britney nude photos Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in C integration and WxPython

2005-09-15 Thread David Wilson
It sounds like your C program and Python script are running under different interpreters. Your C program almost certainly is using a Python version that comes with Cygwin, while the script is probably using a native win32 Python that has wxPython installed. Assuming this is true, then compiling yo

MySQLdb UPDATE does nothing

2005-09-15 Thread John Moore
Hi, I normally work with Java but I'm interested in using Python as well, particularly for little tasks like doing some massaging of data in a MySQL database. Below is my first attempt. I'm sure it's inelegantly written, but my main concern is that the UPDATE sql doesn't actually work, and I c

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread Simon Brunning
On 9/15/05, John Moore <[EMAIL PROTECTED]> wrote: > ... my main concern is that the UPDATE sql doesn't actually > work, and I can't understand why. You probable need to commit your changes. Try a cursor.commit() call. If all the changes make up one logical transaction, do the commit at the end of

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread David Wilson
>> sql="UPDATE product_attribute SET index_column = "+str(index)+" WHERE id = >> "+str(record2[0]) >> .. >> cursor.execute(sql) To allow the DB-API adaptor to correctly take care of value conversion and SQL escaping for you, this should be written as: cursor.execute("UPDATE product_attribute SET

python optimization

2005-09-15 Thread Neal Becker
I use cpython. I'm accustomed (from c++/gcc) to a style of coding that is highly readable, making the assumption that the compiler will do good things to optimize the code despite the style in which it's written. For example, I assume constants are removed from loops. In general, an entity is de

FOUND VIRUS IN MAIL from to <[EMAIL PROTECTED]>

2005-09-15 Thread virusalert
V I R U S A L E R T Our viruschecker found a VIRUS in your email to "<[EMAIL PROTECTED]>". We stopped delivery of this email! Now it is on you to check your system for viruses In file: /usr/local/mav/basedir/j8FCBSXA032608/Part_2.zip Found

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread Simon Brunning
On 9/15/05, John Moore <[EMAIL PROTECTED]> wrote: > I tried that, but got this: > > Traceback (most recent call last): > File "moddb.py", line 31, in ? > cursor.commit() > AttributeError: 'Cursor' object has no attribute 'commit' Oops. I should have said connection.commit(). Posting before

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread Rowdy
John Moore wrote: > Hi, > > I normally work with Java but I'm interested in using Python as well, > particularly for little tasks like doing some massaging of data in a > MySQL database. Below is my first attempt. I'm sure it's inelegantly > written, but my main concern is that the UPDATE sql d

Re: Software bugs aren't inevitable

2005-09-15 Thread Jerzy Karczmarczuk
Steven D'Aprano wrote: > On Wed, 14 Sep 2005 12:23:00 -0700, Paul Rubin wrote: >>Every serious FP language implementation optimizes tail calls and thus >>using recursion instead of iteration doesn't cost any stack space and >>it probably generates the exact same machine code. > > > Are you sayin

Re: Sorting Unix mailboxes

2005-09-15 Thread Tom Anderson
[posted and mailed, in case the OP has given up on reading the group!] On Tue, 13 Sep 2005, [EMAIL PROTECTED] wrote: > I'm writing a program in python to sort the mail in standard Unix > email boxes. In my "prof of concept" example I am coping a letter to a > second mailbox if the letter was send

Re: python optimization

2005-09-15 Thread Chris Cioffi
Hi Neal,   I don't believe that cpython currently does any of the optimizations you refer to below.  That said, it is very reasonable to adopt "a style of coding that is highly readable, making the assumption that the compiler will do good things" when coding in Python.  Python is one of the most h

Self reordering list in Python

2005-09-15 Thread Laszlo Zsolt Nagy
Hello, Do you know how to implement a really efficient self reordering list in Python? (List with a maximum length. When an item is processed, it becomes the first element in the list.) I would like to use this for caching of rendered images. Of course I could implement this in pure Python,

Re: python optimization

2005-09-15 Thread David Wilson
For the most part, CPython performs few optimisations by itself. You may be interested in psyco, which performs several heavy optimisations on running Python code. http://psyco.sf.net/ Defining a function inside a loop in CPython will cause a new function object to be created each and every time

Re: Python Bindings for Dirac, (sorta announcement)

2005-09-15 Thread Matt Hammond
We now also have python bindings for Dirac /encoding/ too. If you feel like playing with this (please do!) the same caveats Michael mentioned apply, and the dependancies are the same (pyrex and dirac). A sample video encoding->decoding->viewing pipeline is in: /Code/Python/Kamaelia/Examples/

Re: python optimization

2005-09-15 Thread Reinhold Birkenfeld
David Wilson wrote: > For the most part, CPython performs few optimisations by itself. You > may be interested in psyco, which performs several heavy optimisations > on running Python code. > > http://psyco.sf.net/ > > Defining a function inside a loop in CPython will cause a new function > objec

Re: wxPython and window sizing

2005-09-15 Thread Franz GEIGER
Ville Voipio wrote: > I have a small problem; I would like to have a reasonable > minimum size for a wx.Window. > > A simplified version of my code: > > > s = wx.SplitterWindow(self, -1) > > curves = wx.Notebook(s) > curve = wx.Window(curves, ID_BLANKCURVE, style=wx.SUN

Re: python optimization

2005-09-15 Thread Thomas Heller
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes: > David Wilson wrote: >> For the most part, CPython performs few optimisations by itself. You >> may be interested in psyco, which performs several heavy optimisations >> on running Python code. >> >> http://psyco.sf.net/ >> >> Defining a function

Re: python optimization

2005-09-15 Thread Neal Becker
Reinhold Birkenfeld wrote: > David Wilson wrote: >> For the most part, CPython performs few optimisations by itself. You >> may be interested in psyco, which performs several heavy optimisations >> on running Python code. >> >> http://psyco.sf.net/ >> I might be, if it supported x86_64, but AFA

Re: Removing duplicates from a list

2005-09-15 Thread drochom
Rubinho napisal(a): > I've a list with duplicate members and I need to make each entry > unique. > hi, other possibility (my newest discovery:) ) >>> a = [1,2,2,4,2,1,3,4] >>> unique = d.fromkeys(a).keys() >>> unique [1, 2, 3, 4] regards przemek -- http://mail.python.org/mailman/listinfo/pyth

Re: Removing duplicates from a list

2005-09-15 Thread martijn
Look at the code below def unique(s): return list(set(s)) def unique2(keys): unique = [] for i in keys: if i not in unique:unique.append(i) return unique tmp = [0,1,2,4,2,2,3,4,1,3,2] print tmp print unique(tmp) print unique2(tmp) -- [0, 1, 2, 4, 2

Thread safe object cache without locking

2005-09-15 Thread Timo
I'm trying to make a thread safe object cache without locking. The objects are cached by the id of the data dict given in __new__. Objects are removed from the cache as soon as they are no longer referenced. The type of the data must be a Python dict (comes from an external source). Here's what I

brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Chris Curvey
I can't be the first person to want to do this, but I also can't seem to find a solution. (Perhaps my Google skills are poor today.) How can I emulate cgi.FieldStorage() for my unit tests so that I don't have to put a web server in the way? what I'd like to do is something like fs = cgi.FieldSt

MySQL & Python

2005-09-15 Thread Ed Hotchkiss
Just migrating now from ASP/to MySQL and Python.   I am trying to create a simple script to access a MySQL DB. The Module for MySQL looks very easy, however I do not understand one thing ...   In ASP, you can just create a new DB with Access. In MySQL, how do I create a database to start playing w

Re: wxPython and window sizing

2005-09-15 Thread Ville Voipio
In article <[EMAIL PROTECTED]>, Franz GEIGER wrote: > Couldn't you register for a handler? Oui, mais... I can figure out a few ugly workarounds. However, my question is if there is a nice and clean way to make wxPython set the minimum size. I'd really hate to start calculating the sizes myself o

Re: Removing duplicates from a list

2005-09-15 Thread drochom
there wasn't any information about ordering... maybe i'll find something better which don't destroy original ordering regards przemek -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQL & Python

2005-09-15 Thread Jaime Wyant
Connect to the database as root. create database databasename; Now grant priveleges accordingly: grant all on databasename to super_user; (I may have the grant syntax screwed up, but you get the idea.) jw On 9/15/05, Ed Hotchkiss <[EMAIL PROTECTED]> wrote: > Just migrating now from ASP/to My

Re: Removing duplicates from a list

2005-09-15 Thread drochom
i suppose this one is faster (but in most cases efficiency doesn't matter) >>> def stable_unique(s): e = {} ret = [] for x in s: if not e.has_key(x): e[x] = 1 ret.append(x) return ret cheers, przemek

help for conversion of NUMARRAY to PIL object

2005-09-15 Thread A. L.
hi, everybody here, I am a newbie to python. I encounter a problem that how to convert an array of numarray to pil object. For example, the data in an image is extracted using Image.getdata, then the data are converted into an array in numarray. But when the array is needed to convert to the

Re: MySQL & Python

2005-09-15 Thread Peter Decker
On 9/15/05, Ed Hotchkiss <[EMAIL PROTECTED]> wrote: > I am trying to create a simple script to access a MySQL DB. > The Module for MySQL looks very easy, however I do not understand one thing > ... > > In ASP, you can just create a new DB with Access. In MySQL, how do I create > a database to

32bit install on 64bit system

2005-09-15 Thread Peter Hartmann
Hello, I could really use some help. I'm trying to install a python program on centos4 x86_64. When I run 'python setup.py' it ends up in /usr/lib64/python2.3/site-packages/ instead of /usr/lib/python2.3/site-packages. It's a problem because the program I'm trying to install is a dependency for

Re: 32bit install on 64bit system

2005-09-15 Thread Christophe
Peter Hartmann a écrit : > Hello, > I could really use some help. I'm trying to install a python program > on centos4 x86_64. When I run 'python setup.py' it ends up in > /usr/lib64/python2.3/site-packages/ instead of > /usr/lib/python2.3/site-packages. It's a problem because the program > I'm

Re: Removing duplicates from a list

2005-09-15 Thread martijn
Ow thanks , i'm I newbie and I did this test. (don't know if this is the best way to do a small speed test) import timeit def unique2(keys): unique = [] for i in keys: if i not in unique:unique.append(i) return unique def unique3(s): e = {} ret = [] for x in s:

Re: Self reordering list in Python

2005-09-15 Thread Thomas Guettler
Am Thu, 15 Sep 2005 15:14:09 +0200 schrieb Laszlo Zsolt Nagy: > > Hello, > > Do you know how to implement a really efficient self reordering list in > Python? (List with a maximum length. When an item is processed, it > becomes the first element in the list.) I would like to use this for >

Re: global interpreter lock

2005-09-15 Thread Michele Simionato
It looks like I am reinventing Twisted and/or Kamelia. This is code I wrote just today to simulate Python 2.5 generator in current Python: import Queue class coroutine(object): def __init__(self, *args, **kw): self.queue = Queue.Queue() self.it = self.__cor__(*args, **kw)

Re: re and escape character

2005-09-15 Thread Thomas Guettler
Am Thu, 15 Sep 2005 14:36:38 +0300 schrieb Sinan Nalkaya: > i re-format incoming messages like this, > command = re.findall("^\002(.{2})\|.*\003$", response)[0] > it works well but when response comes with escape characters , my > command variable crashes, > i cannot parse if response variable is

Re: brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Max M
Chris Curvey wrote: > I can't be the first person to want to do this, but I also can't seem > to find a solution. (Perhaps my Google skills are poor today.) How > can I emulate cgi.FieldStorage() for my unit tests so that I don't have > to put a web server in the way? > > what I'd like to do is

Re: brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Chris Curvey
figured it out... os.environ["QUERY_STRING"] = "foo=bar" fs = cgi.FieldStorage() functionToBeTested(fs) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Search Engine app

2005-09-15 Thread Thomas Guettler
Am Wed, 14 Sep 2005 07:39:35 -0700 schrieb Harlin Seritt: > Hi, > > Is anyone aware of an available open-source/free search engine app > (something similar to HTDig) written in Python that is out there? > Googling has turned up nothing. Thought maybe I'd mine some of you > guys' minds on this. H

Re: help for conversion of NUMARRAY to PIL object

2005-09-15 Thread Robert Kern
A. L. wrote: > hi, everybody here, > > I am a newbie to python. I encounter a problem that how to convert > an array of numarray to pil object. For example, the data in an image > is extracted using Image.getdata, then the data are converted into an > array in numarray. But when the array is

Creating Pie Chart from Python

2005-09-15 Thread Thierry Lam
Let's say I have the following data: 500 objects: -100 are red -300 are blue -the rest are green Is there some python package which can represent the above information in a pie chart? Thanks Thierry -- http://mail.python.org/mailman/listinfo/python-list

Creating Pie Chart from Python

2005-09-15 Thread Thierry Lam
Let's say I have the following data: 500 objects: -100 are red -300 are blue -the rest are green Is there some python package which can represen the above information in a pie chart? Thanks Thierry -- http://mail.python.org/mailman/listinfo/python-list

Example of signaling and creating a python daemon

2005-09-15 Thread David Pratt
Hi. I am running a zope server. Zope runs 4 threads and I have a document processing method that can require minutes to run so I do not want to run out of threads. A solution to this is to run this process asynchronously. What I am hoping to do is send a signal to a python deamon to run a p

Re: Creating Pie Chart from Python

2005-09-15 Thread Will McGugan
Thierry Lam wrote: Let's say I have the following data: 500 objects: -100 are red -300 are blue -the rest are green Is there some python package which can represent the above information in a pie chart? I wrote a wxPython control to render pretty 3D pie charts (see attached piechartwindow.p

Re: improvements for the logging package

2005-09-15 Thread Trent Mick
[EMAIL PROTECTED] wrote] > > >> Changed now in CVS. When 2.4.2 is released it should be there. > > Trent> Is this the same kind of thing as the (generally ill-regarded) > Trent> change in Python 2.2.x (for some x != 0) that added: > > No, I just backported the documentation bit that

Re: Creating Pie Chart from Python

2005-09-15 Thread jepler
There are many. One choice would be Tkinter's Canvas. def frac(n): return 360. * n / 500 import Tkinter c = Tkinter.Canvas(width=100, height=100); c.pack() c.create_arc((2,2,98,98), fill="red", start=frac(0), extent = frac(100)) c.create_arc((2,2,98,98), fill="blue", start=frac(100), extent = fr

Re: Self reordering list in Python

2005-09-15 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: > Do you know how to implement a really efficient self reordering list in > Python? (List with a maximum length. When an item is processed, it > becomes the first element in the list.) I would like to use this for > caching of rendered images. did you check the cheeseshop

Re: Python in C integration and WxPython

2005-09-15 Thread Alain Paschoud
Hi David, Thanks for your answer, but I don't think the problem comes from which Python version I use. I installed the Python from cygwin, but this didn't change everything. Finally, I fullfill the PYTHONPATH environment variable to make the system finding the wx module. It is now able to find it

Re: ddd or eclipse with mod_python

2005-09-15 Thread Trent Mick
[Sakcee wrote] > Hi > > I am using mod_python for web development, I am in need of some ide , > can i use ddd or eclipse with pydev with mod_python. > > can these ide's handle requests from mod_python and run server side > scripts You should be able to debug with Komodo(*): Using the Pytho

Re: Example of signaling and creating a python daemon

2005-09-15 Thread jepler
Here's a program I use to control volume. Run one way, it waits for a Unix signal and adjusts the volume according to the signal received. Run another way, the PID of the daemon process is determined and a signal is sent according to a commandline argument. #!/usr/bin/env python import pyosd, os

Re: Removing duplicates from a list

2005-09-15 Thread drochom
thanks, nice job. but this benchmark is pretty deceptive: try this: (definition of unique2 and unique3 as above) >>> import timeit >>> a = range(1000) >>> t = timeit.Timer('unique2(a)','from __main__ import unique2,a') >>> t2 = timeit.Timer('stable_unique(a)','from __main__ import stable_unique,a

Re: Creating Pie Chart from Python

2005-09-15 Thread Fredrik Lundh
Thierry Lam wrote: > Let's say I have the following data: > > 500 objects: > -100 are red > -300 are blue > -the rest are green > > Is there some python package which can represent the above information > in a pie chart? on a screen? in a web browser? on a printer? -- http://mail.python.

Re: Britney Spears nude

2005-09-15 Thread Tim Peters
[john basha] > send me the britney nude photos Because they're a new feature, you'll have to wait for Python 2.5 to be released. -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating Pie Chart from Python

2005-09-15 Thread Thierry Lam
In a web browser, having a pie chart in some image format will be great. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CSV writer confusion.

2005-09-15 Thread Larry Bates
The someiterable should be something that has a .next method. That would be a list or any object with such a method. In your case it would be the images list. The writer method will iterate over the list and write everything out for you. Don't put it inside a loop yourself. More like (not teste

Re: Creating Pie Chart from Python

2005-09-15 Thread Larry Bates
ReportLab Graphics. -Larry Bates Thierry Lam wrote: > Let's say I have the following data: > > 500 objects: > -100 are red > -300 are blue > -the rest are green > > Is there some python package which can represent the above information > in a pie chart? > > Thanks > Thierry > -- http://mail.

Re: Tkinter add_cascade option_add

2005-09-15 Thread Mikael Olofsson
Eric Brunel wrote in reply to Bob Greschke: > I'm still not sure what your exact requirements are. Do you want to have > a different font for the menu bar labels and the menu items and to set > them via an option_add? If it is what you want, I don't think you can do > it: the menus in the menu b

Re: Britney Spears nude

2005-09-15 Thread Will McGugan
Tim Peters wrote: > [john basha] > >>send me the britney nude photos > > > Because they're a new feature, you'll have to wait for Python 2.5 to > be released. She has just spawned a child process. Give her to Python 2.6 to get back in shape. Will McGugan -- http://www.willmcgugan.com "".joi

Re: O'Reilly book on Twisted

2005-09-15 Thread en.karpachov
On 14 Sep 2005 13:36:53 -0700 Steve M wrote: > Does anybody know: > > What is the relationship between the primary developers of Twisted and > the book? Looks like the primary developers will get a copy from the author, at least. :) Having a book is nice, of course, but I'd rather rely on the m

Re: read stdout/stderr without blocking

2005-09-15 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > Jacek Pop³awski wrote: > > Grant Edwards wrote: > > > >> On 2005-09-12, Jacek Pop?awski <[EMAIL PROTECTED]> wrote: > >> > ready = select.select(tocheck, [], [], 0.25) ##continues > after 0.25s >

Re: Tkinter add_cascade option_add

2005-09-15 Thread jepler
On Thu, Sep 15, 2005 at 06:11:18PM +0200, Mikael Olofsson wrote: > Is this simply a Windows-issue that cannot easily be solved? Or is it > possibly so that this just happens to be a problem on a few > ill-configured computers? Or am I possibly blind? Here's a section from the menu(n) manpage for

Re: Creating Pie Chart from Python

2005-09-15 Thread Fredrik Lundh
Thierry Lam wrote: > In a web browser, having a pie chart in some image format will be great. here's a variation of jepler's tkinter example, using aggdraw to do the drawing and PIL to generate the image. tweak as necessary. # http://effbot.org/zone/draw-agg.htm from aggdraw import * # http://

Re: Britney Spears nude

2005-09-15 Thread Jeremy Jones
Will McGugan wrote: >Tim Peters wrote: > > >>[john basha] >> >> >> >>>send me the britney nude photos >>> >>> >>Because they're a new feature, you'll have to wait for Python 2.5 to >>be released. >> >> > >She has just spawned a child process. Give her to Python 2.6 to get back >in

Re: Oblique Strategies

2005-09-15 Thread robin
Tom Anderson <[EMAIL PROTECTED]> wrote: >On Wed, 14 Sep 2005, robin wrote: > >> The Oblique Strategies were originally a set of one-hundred cards, each >> bearing a short phrase. They were devised by Brian Eno and Peter Schmidt >> as ways of working through creative problems. When a blockage occ

Re: Django Vs Rails

2005-09-15 Thread Jonathan Ellis
James wrote: > I actually like the framework to reflect on my database. I am more of a > visual person. I have tools for all my favorite databases that allow me > to get a glance of ER diagrams and I would rather develop my data > models in these tools rather than in code. Further more I rather lik

Re: Example of signaling and creating a python daemon

2005-09-15 Thread David Pratt
Hi jepler! This is a nice example. I will study it so I can better see what each part is doing. I may have a couple of questions once I have done this because I have not yet daemonized a process and I want to be sure I understand before I attempt to run anything I create. Many thanks. David

Re: Britney Spears nude

2005-09-15 Thread Ian Osgood
Jeremy Jones wrote: > Will McGugan wrote: > > >Tim Peters wrote: > > > > > >>[john basha] > >> > >> > >> > >>>send me the britney nude photos > >>> > >>> > >>Because they're a new feature, you'll have to wait for Python 2.5 to > >>be released. > >> > >> > > > >She has just spawned a child process.

Re: defining __repr__

2005-09-15 Thread Gerrit Holl
sven wrote: > i'd like to define __repr__ in a class to return the standardrepr > a la "<__main__.A instance at 0x015B3DA0>" > plus additional information. > how would i have to do that? > how to get the standardrepr after i've defined __repr__? >>> object.__repr__(4) '' Gerrit. -- Temperature

/usr/lib/python2.3/site-packages/_mysql.so: undefined symbol

2005-09-15 Thread francescomoi
Hello. Python 2.3.4 (#1, Feb 2 2005, 12:11:53) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 MySQL-python-1.2.0 I'm trying to execute this script: -- #!/usr/bin/python import MySQLdb conn = MySQLdb.connect (host = "localhost", user = "root", passwd = "", db = "test

Re: List of integers & L.I.S.

2005-09-15 Thread antonmuhin
I hope nobody have posted similar solution (it's tested, but I didn't submit it to contest): from bisect import bisect_right as find def supernumbers(ls): indices = [0]*len(ls) for i, e in enumerate(ls): indices[e - 1] = i result = [None]*len(ls) borders = [] for i in indices:

  1   2   >