related lists mean value

2010-03-08 Thread dimitri pater - serpia
Hi, I have two related lists: x = [1 ,2, 8, 5, 0, 7] y = ['a', 'a', 'b', 'c', 'c', 'c' ] what I need is a list representing the mean value of 'a', 'b' and 'c' while maintaining the number of items (len): w = [1.5, 1.5, 8, 4, 4, 4] I have looked at iter(tools) and next(), but that did not help

Re: related lists mean value

2010-03-08 Thread dimitri pater - serpia
thanks Chris and MRAB! Looks good, I'll try it out On Tue, Mar 9, 2010 at 12:22 AM, Chris Rebert c...@rebertia.com wrote: On Mon, Mar 8, 2010 at 2:34 PM, dimitri pater - serpia dimitri.pa...@gmail.com wrote: Hi, I have two related lists: x = [1 ,2, 8, 5, 0, 7] y = ['a', 'a', 'b', 'c', 'c

Re: Python Success stories

2008-04-22 Thread dimitri pater
http://code.google.com/appengine/docs/whatisgoogleappengine.html 2008/4/22 Ivan Illarionov [EMAIL PROTECTED]: On 22 апр, 14:25, azrael [EMAIL PROTECTED] wrote: [] This hurts. Please give me informations about realy famous aplications. What do you mean by really famous?

uninstall python2.5 on debian

2007-09-18 Thread dimitri pater
Hello, both python2.3 and python2.5 are installed on my Debian webserver. For some reason, I would like to uninstall Python2.5 which was installed from source (make install) and keep 2.3. I have tried make uninstall and searched the web, but that did not help me. I guess rm -Rf python2.5 is not a

StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
Hi, I am trying to insert an image, which is stored as a blob in MySQL, into a table using Reportlab. I have tried this: from StringIO import StringIO cfoto = StringIO(result[0][1]) # where result[0][1] is the 'blob' cfoto.seek(0) foto=cfoto.getvalue But when I do: print foto, I see something

StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
-- Forwarded message -- From: dimitri pater [EMAIL PROTECTED] Date: Sep 5, 2007 9:13 PM Subject: Re: StringIO MySQL data blob Image problem To: Tim Golden [EMAIL PROTECTED] Well, I'm mystified. Not by your results: that exactly what I expected to get, but because you're doing

Re: StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
the data from the first record. Tried flush(), truncate(0), but it didn't work. (My mistake probably ;-) But the images show in the PDF so that's fine for now. On 9/5/07, dimitri pater [EMAIL PROTECTED] wrote: -- Forwarded message -- From: dimitri pater [EMAIL PROTECTED] Date: Sep 5

Re: StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
ah, sorry a+=1 should be after 'Do stuff here' of course... On 9/5/07, dimitri pater [EMAIL PROTECTED] wrote: Hi, the following code works when inserting images in reportlab tables: (result4 is a query result) a=0 for i in result4: cfoto = StringIO() cfoto.write

Joining elements in a list to 1 element

2007-08-23 Thread dimitri pater
Dear all, I am having trouble joining elements in a list into 1 element. e.g. ['a','b','c'] into ['abc'] so that len(list) returns 1 I have tried the following: myList = ['a','b','c'] print myList ['a', 'b', 'c'] # get type print type(myList) type 'list' # get length print len(myList) 3 myList2

webbrowser.open question force Firefox

2007-08-06 Thread dimitri pater
Hi, I have a question regarding the use of webbrowser.open. On a windows XP machine, MS-IE is set as the default browser so when I do: webbrowser.open('http://localhost:8080') IE starts with this address. But in stead of launching IE, I want to launch Firefox *without* setting Firefox as the

Re: favourite editor

2007-02-13 Thread dimitri pater
You could try SPE, but that's really unstable, and no help manual to read ;-) But, there is a tutorial on SPE here: www.serpia.org/spe regards, Dimitri -- --- You can't have everything. Where would you put it? -- Steven Wright --- please visit www.serpia.org --

Re: Regular Expressions

2007-02-10 Thread dimitri pater
Hi, a good start: http://diveintopython.org/regular_expressions/index.html On 10 Feb 2007 15:30:04 -0800, Paul Rubin http://phr.cx@nospam.invalid wrote: Geoff Hill [EMAIL PROTECTED] writes: What's the way to go about learning Python's regular expressions? I feel like such an idiot - being so

Re: Best Free and Open Source Python IDE

2007-02-09 Thread dimitri pater
Hi, the hunt for free Python IDE's is a never ending journey... just make up your mind and invest some money in WingIDE. It is not *that* expensive and in the end it will save you lots of time (=money) hunting for the perfect free Python Ide. Just download the time limited free version of WingIDE

Re: python linux distro

2007-02-08 Thread dimitri pater
Hi, the world doesn't need another Linux distro, there are too many already... ( 100) I believe it's a better idea to spend your time contributing to an existing distro (e.g. http://www.ubuntu.com/developers/bounties) doing Python related stuff. Besides that, all distros I know of (4) already

Re: Python editor

2007-02-07 Thread dimitri pater
I read about a free manual with adds, but I can find it no-where. you can find a tutorial here : http://www.serpia.org/spe You can't have everything. Where would you put it? -- Steven Wright --- please visit www.serpia.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphs, bar charts, etc

2007-02-06 Thread dimitri pater
Hi, check out chartdirector : http://www.advsofteng.com/ it's not free, but very easy to use right now I am testing it here: http://www.serpia.org/water a very simple barchart regards, Dimitri On 2/6/07, Jan Danielsson [EMAIL PROTECTED] wrote: Hello all, I have some data in a postgresql

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread dimitri pater
On 1/24/07, Laurent Rahuel [EMAIL PROTECTED] wrote: Hi, I known this can be impossible but what about an HTML GUI ? Yep, I think you should consider a HTML GUI. I have just finished a project using CherryPy running on localhost. The big advantage is that the app runs on Linux, Mac and Win

Re: Python does not play well with others

2007-01-24 Thread dimitri pater
On 1/24/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: John MySQLdb has version and platform compatibility problems. Got specific examples? I've successfully used MySQLdb on Linux, Mac and Solaris with no compatibility problems at all. I have been using MySLQdb also on Linux, Mac *and*

Re: matplotlib button problem

2007-01-24 Thread dimitri pater
Hi, post your question on matplotlib-users@lists.sourceforge.net regards, Dimitri On 24 Jan 2007 13:37:22 -0800, Zielinski [EMAIL PROTECTED] wrote: Hi, Recently I started to use matplotlib with python. Now I would like to have interaction with my plots. Here is the problem: I have a long

Re: SPE (Stani's Python Editor) web site?

2006-12-06 Thread dimitri pater
Hi, You would do me and other gurus a great favour if you put it on a server somewhere. I can put it on my server (serpia.org) if you want to, just email it to me and you can download it from serpia.org/spe --- You can't have everything. Where would you put it? -- Steven Wright --- please

Re: What do I look for in a shared Python host?

2006-11-18 Thread dimitri pater
Hi, is there any reason for you wanting to use a shared host? Just asking.. Maybe you could use a VPS as this is not too expensive these days. Of course, it would require more work to set things up. But it's not too hard... (eg using apt-get,webmin,some basic Linux skills using the command line)

Re: Python deployment options.

2006-11-08 Thread dimitri pater
Hi,try:http://www.py2exe.org/regards,DimitriOn 8 Nov 2006 02:37:42 -0800, king kikapu [EMAIL PROTECTED] wrote:Hi to all folks here,i just bought a book and started reading about this language. I want to ask what options do we have to deploy a python program tousers that do not have the labguage

[ANN] serpia.org needs more tutorials

2006-10-31 Thread dimitri pater
Hi,for almost a year now I have been running my serpia.org website. This website is dedicated to Python stuff. I figured that it would be a good idea to share some experiences while learning the language and that is why I started this website. Maybe some of you share this idea and would like to

Re: Python complaining about CherryPY?

2006-08-19 Thread dimitri pater
Hi Thomas,try the CP mailinglist: http://www.cherrypy.org/wiki/CherryPyMailingLists , they can probably answer your question.cheers,Dimitri On 8/19/06, Thomas McLean [EMAIL PROTECTED] wrote: Hi all,First post to the list, so first off, I'm new to Python and everythingsurrounding it so if you can

Re: GUI in Python using wxGlade

2006-06-16 Thread dimitri pater
the link should be:www.serpia.org/wxgladethanks for finding it, UrsusMaximus ;-)Dimitri On 16 Jun 2006 06:08:33 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:Did you paste any code ?Also the link for the next message is not working . John Salerno wrote: [EMAIL PROTECTED] wrote: I am a

Re: New-style Python icons

2006-03-20 Thread dimitri pater
wow,good work!thanks,DimitriOn 20 Mar 2006 08:56:59 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:Personally, I *like* the new website look, and I'm glad to see Python having a proper logo at last!I've taken the opportunity to knock up some icons using it, finallybanishing the poor old

Which GUI toolkit is THE best?

2006-03-10 Thread dimitri pater
Hi,in stead of going for the traditional GUIS like wxPython, PyGtk and the like, you could consider using a browser based GUI. Try CherryPy for instance. See also here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442481regards,Dimitri On 3/10/06, invitro81 [EMAIL PROTECTED]

Re: New python.org website

2006-03-07 Thread dimitri pater
I do like it, one thing I noticed though:http://www.python.org/doc/ has an image (batteries-included.jpg), a very nice image but it says new V 1.6. Okay , this may not seem important, but maybe someone (the original artist?) can update it. regards,DimitriOn 7 Mar 2006 11:03:27 -0800, projecktzero

Re: ANN: SPE 0.8.2.a Python IDE: configure styles, interactive terminals ubuntu

2006-01-28 Thread dimitri pater
Hi,From: http://www.serpia.org/spe switching to http://www.serpia.org/sorryplease enable _javascript_ in your browser to visit serpia.orgif you think that sucks, please contact me about it if not, enable _javascript_ and click hereIf you would like to know how much people find, it sucks, this is

Re: How run web software *locally* easily?

2006-01-06 Thread dimitri pater
Check out this recipe using CherryPy ;-)http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442481CherryPy's server runs on localhost, also see my tutorial here: www.serpia.org/cherrypybye,DimitriOn 5 Jan 2006 16:13:01 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If grandma wanted to run

Re: Microsoft's JavaScript doc's newfangled problem

2005-12-27 Thread dimitri pater
On the other hand, in terms of documentation quality, technologicalexcellence, responsibility in software, Microsoft in the 21st century is the holder of human progress when compared to the motherfucking OpenSourcers lying thru their teeth fuckheads. XahThis is not amusing anymore, somebody please

Re: python website

2005-12-16 Thread dimitri pater
hello,look here: http://www.cherrypy.org/wiki/CherryPySuccessStory for websites created with CherryPyand there is more (django and turbogears spring to mind) bye,DimitriOn 12/16/05, carmel stanley [EMAIL PROTECTED] wrote: I am interested in doing a web site in python can any body direct me

Re: MySQLdb-python how to install on MacOsX

2005-12-16 Thread dimitri pater
thanks Adam!Like Steve, I was experiencing the same problem. I tried so may other things, but finally gave up. But now it works!and thank you Steve, for your postgreetz,Dimitri On 16 Dec 2005 12:16:13 -0800, adtroy [EMAIL PROTECTED] wrote: Steve,I had the same problem, the only thing I found that

Re: Fund raising for SPE (Python IDE) on Mac Os X is great success!!

2005-10-20 Thread dimitri pater
Dear Stani, It is good to hear that the donation was a success. And you deserve it, your contribution to the Python community is an example fot others and I am convinced that every donation, be it large or small, is well spent! A lot of us use SPE, don't we? greetz, DimitriOn 20 Oct 2005 12:38:04

Re: A Moronicity of Guido van Rossum

2005-09-30 Thread dimitri pater
Yes, it would. Note that the word lunatic is derived from the Latin wordluna, meaning moon. so, he is a just another lunitac barking at the moon? well, err barking at the python list... greetz, dimitri -- http://mail.python.org/mailman/listinfo/python-list

Re: A Moronicity of Guido van Rossum

2005-09-30 Thread dimitri pater
that's lunatic, of course (check spelling is not in my system yet)On 10/1/05, dimitri pater [EMAIL PROTECTED] wrote: Yes, it would. Note that the word lunatic is derived from the Latin wordluna, meaning moon. so, he is a just another lunitac barking at the moon? well, err barking at the python

Re: Python CGI and Firefox vs IE

2005-09-07 Thread dimitri pater
On 7 Sep 2005 11:10:00 -0700, Jason [EMAIL PROTECTED] wrote: IE...sigh Yeah, I know what you mean. Here's another one that doesn't work in IE, but it does work in Firefox: canvas = pid.PILCanvas() canvas.drawRect(0,400, 500, 0, fillColor=pid.floralwhite, edgeColor=pid.maroon ) snip # display

Re: Python / web

2005-09-01 Thread dimitri pater
On 9/1/05, Larry Bates [EMAIL PROTECTED] wrote: flexibility comes complexity.For less complex needs there are othermore lightweight things like CherryPy. Yes, I agree CherryPy is very nice. I am currently updating my site using CherryPy (and CherryTemplate) and it all works very nice. You'll learn

Re: change date format

2005-08-31 Thread dimitri pater
On 8/31/05, Fredrik Lundh [EMAIL PROTECTED] wrote: Lars Gustäbel wrote: Not a single occurrence of the f**k word. You're making progress.perhaps, but why is he posting apache questions to the python list? because we know all, we see all, we are Python programing (sic) morons dimitri --

Re: Should I move to Amsterdam?

2005-08-25 Thread dimitri pater
The problem with the world is stupidity. Not saying there should be acapital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? Frank Zappa Geef mij wat vloerbedekking onder deze vette zwevende sofa sorry, very off-topic,

Re: up to date books?

2005-08-18 Thread dimitri pater
On 8/18/05, Jon Hewer [EMAIL PROTECTED] wrote: mark pilgrim's dive into python is a good book if you're new to python I agree that dive into python is a *very* good python book, but as it is says on http://diveintopython.org/ it is for experienced programmers. So if you are new to Python and to

Re: Help!

2005-08-16 Thread dimitri pater
Hi, the MS-DOS Prompt is actually the Python shell: Now type: print Hello Ert and it returns: Hello Ert Your first Python program! Do yourself a favour and google for python tutorials good luck, dimitri On 8/17/05, Ert Ert [EMAIL PROTECTED] wrote: When ever i try to open python it opens as a

tuple assign variables

2005-08-12 Thread dimitri pater
Hello, selecting a record from a MySQL database results in a tuple like this: (('Evelyn', 'Dog', 'No'),) I want to assign every item of that tuple to a variable using this code (deep_list is taken from the Python Cookbook): def deep_list(x): if type(x)!=type( () ): return x return

Re: email format in python

2005-07-20 Thread dimitri pater
hello, this one works quite well on validating email syntax: http://www.secureprogramming.com/?action=""> regards, DimitriOn 7/20/05, Dark Cowherd [EMAIL PROTECTED] wrote: This seems to give reasonable results.import repattern = r'[EMAIL PROTECTED],4}\b'pattobj = re.compile(pattern)ps =

Re: python certification

2005-07-20 Thread dimitri pater
Hello, Python is not about certificates or diplomas, so do not spend any money on it (the other guy was only joking). If you want to show your python skills to others (like the teachers from the college you want to go to), use this list. Participate in discusions, ask quesions, maybe even write a

Re: Good starterbook for learning Python?

2005-07-05 Thread dimitri pater
hi, although Dive into Python is a *very, very* good Python book (I own the real book) I would not recommend it as your first book to learn Python. Take a look at Practical Python by Hetland first for instance, it will teach you all the basic stuff. Then move over to Dive into Python and also

Re: some trouble with MySQLdb

2005-06-30 Thread dimitri pater
try: db = MySQLdb.connect(host=localhost, user=user, passwd=pass, db=myDB) localhost can be a URL also (if MySQL is set up properly in the first place) regards, DimtiriOn 6/30/05, nephish [EMAIL PROTECTED] wrote: Hey there all,i have a question about how to point my python install to my sql

string capitalize sentence

2005-06-23 Thread dimitri pater
Hello! I want to capitalize every sentence in a string: harry is a strange guy. so is his sister, but at least she is not a guy. i am. to: Harry is a strange guy. So is his sister, but at least she is not a guy. I am. I came up with the following solution: a = 'harry is a strange guy. so is his

Re: Python 2.4 and BLT

2005-06-02 Thread dimitri pater
In the past (I was using tcl/tk to be more precise) I used Blt and I was very satisfied with it. But now I use Matplotlib for my Python apps. And it is amazing! You really should try it. I use it with PyGTK and it is truly wonderful. http://matplotlib.sourceforge.net/ DimitriOn 6/2/05, Lyddall's

Re: Displaying formatted - data with TKinter

2005-05-02 Thread dimitri pater
hello, take a look at the multilistbox: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52266 http://www.haucks.org/download/MultiListbox.py.gz I use it for this purpose, it looks quite nice regards, DimitriOn 1 May 2005 19:10:19 -0700, custard_pie [EMAIL PROTECTED] wrote: Hi,..I found

Tkinter multilistbox in scrolledframe

2005-04-15 Thread dimitri pater
Hello! I recently included this very nice recipe for the multilistbox in my application: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52266 however, I can't seem to place it inti a scrolledframe, this is what I do: /snip self.frame1 = Pmw.ScrolledFrame(page,

Re: Glade for Windows and Python

2005-04-15 Thread dimitri pater
It's not exactly Glade, but did you try wxGlade? dimitriOn 4/16/05, Richard Lyons [EMAIL PROTECTED] wrote: Has anyone been successful in using Glade for Windows with Python?--http://mail.python.org/mailman/listinfo/python-list -- Please visit dimitri's website: www.serpia.com --

nested tuple slice

2005-04-12 Thread dimitri pater
hello! I want to change a nested tuple like: tuple = (('goat', 90, 100), ('cat', 80, 80), ('platypus', 60, 800)) into: tuple = (('goat', 90), ('cat', 80), ('platypus', 60)) in other words, slice the first elements of every index Any ideas on how to do this in an elegant, pythonic way? Best

Re: nested tuple slice

2005-04-12 Thread dimitri pater
Message- From: python-list-bounces+mleeds=[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of dimitri pater Sent: Tuesday, April 12, 2005 5:49 PM To: python-list@python.org Subject: nested tuple slice hello! I want to change a nested tuple like: tuple = (('goat', 90, 100), ('cat', 80

Re: File Uploads

2005-03-27 Thread dimitri pater
Maybe this helps: http://www.voidspace.org.uk/python/cgi.shtml#upload I use it, it works for fine me Maybe it will give you some clues on how to tweak your own script. Dimitri On Sun, 27 Mar 2005 10:32:20 -0700, Doug Helm [EMAIL PROTECTED] wrote: Hey, Folks: I'm trying to write a very

Re: File Uploads

2005-03-27 Thread dimitri pater
as the code I've uploaded (just hangs). But, OK. You have it working, so it must be a systems issue. Are you also on a Windows IIS web server? Do you have CGI configured the same way (i.e. .py = python.exe -u %s %s)? Thanks. Doug dimitri pater [EMAIL PROTECTED] wrote in message news

how to refresh grid on a notebook?

2005-03-19 Thread dimitri pater
Hello, To be honest, I also posted this on the wxPython mailing list. But I thought maybe some of you on the python list can help me... I am trying to refresh a pane of a notebook that contains a grid that contains data from a MySQL database. Here is the code (sorry, it's quite long):

Re: Python glade tute

2005-03-04 Thread dimitri pater
nice start! screenshots would improve it a lot greetz, Dimitri On 4 Mar 2005 03:31:34 -0800, somesh [EMAIL PROTECTED] wrote: hello, I wrote a small tute for my brother to teach him python + glade, plz see, and suggest to make it more professional , In tute I discussed on Glade + Python for

Re: Python glade tute

2005-03-04 Thread dimitri pater
hello, I would certainly want to collaborate on writing Python tutorial for kids (I've got a small kids myself (7, 5, 3)). I already wrote some tutorials that make heavy use of screenshots (serpia.com) but they are for big kids like us ;-) Please contact me, maybe we can work something out. I'd be

Re: How do I make my program start fullscreen ?

2005-02-18 Thread dimitri pater
If you're using Tkinter, the next url might help: http://effbot.org/zone/tkinter-toplevel-fullscreen.htm On Tue, 15 Feb 2005 23:35:05 +0100, BOOGIEMAN [EMAIL PROTECTED] wrote: os = windows xp How do I make myprogram.py start fullscreen at windows command prompt ? Also I made it as

walktree browser filenames problem

2005-02-04 Thread dimitri pater
Hello, I use the following script to list the files and download files from my website (99% of the code is from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/200131). The problem is that the filenames are cut off in the status bar of the browser because of the white space (eg

Re: walktree browser filenames problem

2005-02-04 Thread dimitri pater
thanks! now it works: ret.append(' trtd class=filea href=http://e-bench.serpia.com/upload/%s%s/a/td/tr\n' % (urllib.quote(escape(name)),escape(name))) bye, Dimitri On Fri, 4 Feb 2005 11:45:17 -, Richard Brodie [EMAIL PROTECTED] wrote: dimitri pater [EMAIL PROTECTED] wrote in message

barchart for webpage needed

2005-01-31 Thread dimitri pater
Hello, I am looking for a Python tool to create graphs and charts on a webpage. Chartdirector is too expensive for me. A simple script for creating a barchart should be sufficient as a starting point. Thanks! Dimitri -- Please visit dimitri's website: www.serpia.com --

Re: Python IDE

2004-12-14 Thread dimitri pater
Hi, Try WingIDE if you have some money (about 35 E/$ for the personal version) to spend, it's worth every (euro)cent. But please try SPE first, maybe that's enough for you. Dimitri On Tue, 14 Dec 2004 11:36:34 -0500, Chris [EMAIL PROTECTED] wrote: What IDE's do y'all recommend for Python? I'm