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 me. I'm
a bit stuck here, so your help is appreciated!

thanks!
Dimitri
-- 
http://mail.python.org/mailman/listinfo/python-list


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', '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 me. I'm
 a bit stuck here, so your help is appreciated!

 from __future__ import division

 def group(keys, values):
    #requires None not in keys
    groups = []
    cur_key = None
    cur_vals = None
    for key, val in zip(keys, values):
        if key != cur_key:
            if cur_key is not None:
                groups.append((cur_key, cur_vals))
            cur_vals = [val]
            cur_key = key
        else:
            cur_vals.append(val)
    groups.append((cur_key, cur_vals))
    return groups

 def average(lst):
    return sum(lst) / len(lst)

 def process(x, y):
    result = []
    for key, vals in group(y, x):
        avg = average(vals)
        for i in xrange(len(vals)):
            result.append(avg)
    return result

 x = [1 ,2, 8, 5, 0, 7]
 y = ['a', 'a', 'b', 'c', 'c', 'c' ]

 print process(x, y)
 #= [1.5, 1.5, 8.0, 4.0, 4.0, 4.0]

 It could be tweaked to use itertools.groupby(), but it would probably
 be less efficient/clear.

 Cheers,
 Chris
 --
 http://blog.rebertia.com




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

  Information is here:
  http://www.python.org/about/quotes/

  Are YouTube and Google famous enough?

  --
  Ivan


 --
  http://mail.python.org/mailman/listinfo/python-list



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

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 wise thing to do.

thanks,
Dimitri

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


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 similar to this:
array('c','\xff\xd8\etc...etc..')
This is also the string I see in the table, in stead of the actual image.

I have tried:
cfoto StringIO()
cfoto.write(result[0][1].tostring())
foto=cfoto.getvalue()
that returns:
ÿØÿàúlbo¤qÁ5¼–Ò\¸•£ˆˆ‡Y|Aø—­,ñé–ú…ìâm3Z¸ŒÁfêñNÔ,­¡¾ÚÀIæÃt[EMAIL 
PROTECTED]'ÍkÕÁå¼sàßd˜ª²«ÍÉ1؜Ï
‡^ÖJ*™C(r)ë{:tâ¥_‡Çâ–´°joÙÃ
¿C(c)¯äÜ[)¯gN«ÃæXßi etc... etc...
and return an UnicodeDecodeError when I try to insert this into the table

Any ideas or clues someone? Your help is appreciated.
Dimitri
(BTW, the MySQL image blob is valid, it shows up in MySQL Query Browser)

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


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 everything *except*
 manipulating an image and putting it into a PDF via ReportLab.

Dear Tim,
you are right of course, I have been trying to put the StringIO in a temp file:
cfoto=StringIO
cfoto.write(result[0][1].tostring())
dfoto=cfoto.getvalue()
fileFoto=open('temp.jpg','wb')
fileFoto.write(dfoto)

and indeed, the blob from MySQL is saved as an image!
however,
foto= Image('temp.jpg')
and inserting foto into a table results in:
x = struct.unpack('B', image.read(1))
error: unpack str size does not match format
oh, well... still needs some work
BTW: I used 'local' images before (I mean they did not originate from
a DB), that worked well in Reportlab's tables.
Thanks, I am getting there (I think)


-- 
---
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: StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
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(result4[a][9].tostring())
   dfoto = cfoto.getvalue()
   fileFoto = open(str(a)+'temp.jpg','wb')
   fileFoto.write(dfoto)
   fileFoto.close()
   foto = Image(str(a)+'temp.jpg')
   a+=1

  Do stuff here (insert the Image)

The problem with this code is that I need to create a unique file
(str(a)+'temp.jpg'), I tried to use a single temp.jpg but it kept
using 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, 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 everything *except*
  manipulating an image and putting it into a PDF via ReportLab.
 
 Dear Tim,
 you are right of course, I have been trying to put the StringIO in a temp 
 file:
 cfoto=StringIO
 cfoto.write(result[0][1].tostring())
 dfoto=cfoto.getvalue()
 fileFoto=open('temp.jpg','wb')
 fileFoto.write(dfoto)

 and indeed, the blob from MySQL is saved as an image!
 however,
 foto= Image('temp.jpg')
 and inserting foto into a table results in:
 x = struct.unpack('B', image.read(1))
 error: unpack str size does not match format
 oh, well... still needs some work
 BTW: I used 'local' images before (I mean they did not originate from
 a DB), that worked well in Reportlab's tables.
 Thanks, I am getting there (I think)


 --
 ---
 You can't have everything. Where would you put it? -- Steven Wright
 ---
 please visit www.serpia.org



-- 
---
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: 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(result4[a][9].tostring())
dfoto = cfoto.getvalue()
fileFoto = open(str(a)+'temp.jpg','wb')
fileFoto.write(dfoto)
fileFoto.close()
foto = Image(str(a)+'temp.jpg')
a+=1

   Do stuff here (insert the Image)

 The problem with this code is that I need to create a unique file
 (str(a)+'temp.jpg'), I tried to use a single temp.jpg but it kept
 using 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, 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 everything *except*
   manipulating an image and putting it into a PDF via ReportLab.
  
  Dear Tim,
  you are right of course, I have been trying to put the StringIO in a temp 
  file:
  cfoto=StringIO
  cfoto.write(result[0][1].tostring())
  dfoto=cfoto.getvalue()
  fileFoto=open('temp.jpg','wb')
  fileFoto.write(dfoto)
 
  and indeed, the blob from MySQL is saved as an image!
  however,
  foto= Image('temp.jpg')
  and inserting foto into a table results in:
  x = struct.unpack('B', image.read(1))
  error: unpack str size does not match format
  oh, well... still needs some work
  BTW: I used 'local' images before (I mean they did not originate from
  a DB), that worked well in Reportlab's tables.
  Thanks, I am getting there (I think)
 
 
  --
  ---
  You can't have everything. Where would you put it? -- Steven Wright
  ---
  please visit www.serpia.org
 


 --
 ---
 You can't have everything. Where would you put it? -- Steven Wright
 ---
 please visit www.serpia.org



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


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 = ''.join(myList)
print myList2
abc
# get type
print type(myList2)
type 'str'
# get length
print len(myList2)
3

As you can see, the type 'list' turns into 'str' after .join. Doing
something like list(''.join(myList)) returns the type 'list' but still has 3
elements.

thanks,
Dimitri

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

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 default browser globally on this machine.

Any hints, ideas? Your help is most appreciated.
regards,
Dimitri
-- 
---
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: 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
-- 
http://mail.python.org/mailman/listinfo/python-list

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 strong in a programming language but
knowing
 nothing about RE.

Read the documentation?
--
http://mail.python.org/mailman/listinfo/python-list





--
---
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: 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 and see for yourself. I don't think you'll be disappointed, I use
it every day and it's a real time saver for my projects. And there is
another priceless feature, the WingIDE guys will answer every question in
the mailing list. Now, how's that?

regards,
Dimitri

On 2/9/07, Stef Mientki [EMAIL PROTECTED] wrote:


Szabolcs Nagy wrote:
 Srikanth wrote:
 Yes,

 All I need is a good IDE, I can't find something like Eclipse (JDT).
 Eclipse has a Python IDE plug-in but it's not that great. Please
 recommend.

 Thanks,
 Srikanth

 try pida
 http://pida.co.uk/index.php/Main_Page

nice idea to re-use components you already have.

Which brings me to some other questions on waste:
- isn't it a pitty so many people are involved in writing another editor /
IDE ?
- isn't it a waste for newbies to evaluate a dozen editors / IDE's ?

What anser do we really give here ?
Aren't we just telling the guy,
what we've chozen (with our limited overview of our newbie time) ;-)
(sorry, I also gave an answer ;-)

Can't we persuade the next newbie, asking this question,
to start some kind of wiki page,
where the differences between editors / IDE's are listed ?

Unfortunately he number of IDE's / editors is so large,
a simple 2 dimensional array of features would become too large ;-)
Maybe a first split would be the required OS ?
Next split could be editor-features and IDE features ?

just some thoughts,
of a some months old newbie,
Stef Mientki
--
http://mail.python.org/mailman/listinfo/python-list





--
---
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: 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 have a lot of Python
packages ready for download.
regards,
Dimitri

On 8 Feb 2007 06:44:22 -0800, azrael [EMAIL PROTECTED] wrote:


Hy guys

last night i was lying in my bed and thinking about something. is
there any linux distro that is primary oriented to python. you know
what i mean. no need for php, java, or something like this. pure
python and containig all the funky modules like scipy, numpy,
boaconstructor (wx of course). something like the python enthought
edition, but all this on a distro included. maybe psql but persistant
predered, zope of course. everything a developer is ever going to
need.
So i stood up, sat down on my ugly acer notebook with a python stiker
on it and made a huge list of cool modles i would prefer. I would like
to make such a distro but i am not a linux pro. so this is going to
stay just a idea. i thouht it should be realy user fredly like sabayon
or ubuntu (without xgel). if this were a live distro it would be
amazing.
I know, dont expet someone else to do your work, but is there anyone
who likes the idea and has the knowledge i dont have.
I also know for quantian (cool distro), but for me, there is too much
other crap and not enough python.

i even got the nam of it. maybee not the best but it fits the context.
PyTux



---
and no, I am not a junkee, I'm addicted to Python

--
http://mail.python.org/mailman/listinfo/python-list





--
---
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: 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 table which I view through a web
interface (the web interface is written in python -- using mod_python
under apache 2.2). Now I would like to represent this data as graphs,
bar charts, etc.

   I know about matplotlib, and it seemed like exactly what I was
looking for. I tried importing it in my script, but it gave me some
error about a home directory not being writable. I'm not sure I like the
idea of it require to be able to write somewhere. Am I using it wrong?

   Is there something else I can use which can produce graphs easily?

--
Kind regards,
Jan Danielsson
--
http://mail.python.org/mailman/listinfo/python-list





--
---
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: 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 using a browser without any problem. You can use css
and js to polish the user interface and usability of your application.

regards,
Dimitri
---
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: 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* Windows in various
applications and never encountered compatibility problems in the last two or
three years.

best regards,
Dimitri
---
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: 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 vector of data, to long to display it on one picture,
because of, well you know to much data to big mess... so I decided to
extract some data from long_vector to short_vector with 100 elements.
So I have:
   data_position = 1
   interval = 100
   for i in range (0, interval):
  short_vector[i] = long_vector[data_position*interval + i]

Then I plot it. works fine...
Now I created a button next I would like to press it and change the
data_position to +1 every time i press it, of course, and redraw the
picture. It can be a key on the keyboard, I don't care.

Bottom line: how to change the global variable with the button in
matplotlib, and redraw a picture using this variable

Thanks for help
Jerzy
[EMAIL PROTECTED]

--
http://mail.python.org/mailman/listinfo/python-list





--
---
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: 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 visit www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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)
regards,
Dimitri
(I use a VPS at rimuhostig ($20/month), but there are many, many more)

On 18 Nov 2006 11:15:28 -0800, Fuzzyman [EMAIL PROTECTED] wrote:



walterbyrd wrote:
 For example:

 - If I want to use Django, I need either FastCGI or Apache
 2.X/mod_python 3.x

 - if I want to use TurboGears, I need Python 2.4: not 2.3 and not 2.5

 - I have just learned that some hosters have TCs that forbid long
 running processes. I am not sure exactly what that means. Except I
 understand it can be a problem if using Cherrypy/TurboGears

 - I have read that mod_python before 3.x can be difficult

 What other gotchas would I look for?

The best host for Python (including Django and Turbogears), try
webfaction. They used to be known as Python-hosting.com and offer great
support for Python.

Fuzzyman
http://www.voidspace.org.uk/index2.shtml

--
http://mail.python.org/mailman/listinfo/python-list





--
---
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: 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 installed ??I mean, can i make an executable file, or something that contains theruntime and the modules that the program only use or am i forced to
download the language to the user machine so the .pyfiles can be run??Thanks in advance,king kikapu--http://mail.python.org/mailman/listinfo/python-list
-- ---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

[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 contribute your tutorials/thoughts/articles/whatever to serpia.org. So, if you have written tutorials or any other material on Python, just contact me and I will happy to add it to 
serpia.org. I will give you full credit of course and make a nice layout.And yes, the website has those annoying Google ads. But it helps me paying the hosting bills ;-)
Thanks,Dimitri-- ---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: 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 please ignore my ignorance.I setup a cherryPY server so that I could use sabnzbd but once, I have
installed/configured what I was told by the tutorials and everything else.I run ubuntu x86 dapper FYI.The error messages I get from the logs are as follows (which don't reallymean to muchto me):
19/Aug/2006:20:55:33 HTTP INFO Traceback (most recent call last):File /usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py, line110, in _runapplyFilters('before_finalize')File /usr/lib/python2.4/site-packages/cherrypy/filters/__init__.py,
line 151, in applyFiltersmethod()File/home/tam/www/sites/domain1/htdocs/SABnzbd/sabnzbd/utils/multiauth/filter.py,line 59, in beforeFinalizecherrypy.response.body = rsrc.callable
(rsrc.instance,File /home/tam/www/sites/domain1/htdocs/SABnzbd/sabnzbd/interface.py,line 116, in indexinfo, pnfo_list, bytespersec = build_header()File /home/tam/www/sites/domain1/htdocs/SABnzbd/sabnzbd/interface.py,
line 933, in build_headerheader = { 'version':sabnzbd.__version__, 'paused':sabnzbd.paused(),File /home/tam/www/sites/domain1/htdocs/SABnzbd/sabnzbd/__init__.py,line 753, in pausedreturn 
DOWNLOADER.pausedAttributeError: 'NoneType' object has no attribute 'paused'127.0.0.1 - - [19/Aug/2006:20:55:33] POST /sabnzbd/ HTTP/1.1 500 791
http://localhost:8080/sabnzbd/ Mozilla/5.0 (X11; U; Linux i686; en-US;rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4So if anyone can shed some light on this I would be very greatful.
Thanks for your time.Tam.--http://mail.python.org/mailman/listinfo/python-list-- 
---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: 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 newbie. I was looking for some code where I could a list of  different items from a file and display it in a list box. Then give a
  user the capability to select some.   Basically, reading and writing to a file and displaying them in  different widgets...thats something I am looking for. If anybody can
  point me to some good example tutorials...I will be greatly helped.   Thanks,   Every help is appreciated  Have you tried looking at the code in the wxPython demo? In the ListBox
 control demo, it populates a ListBox with items from a list, but you could easily translate that into reading from a file, I think. Here's the full code in case you don't have the demo:
   importwx   #---   # This listbox subclass lets you type the starting letters of what you want to
  # select, and scrolls the list to the match if it is found.  class FindPrefixListBox(wx.ListBox):  def __init__(self, parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], style=0, validator=
wx.DefaultValidator):  wx.ListBox.__init__(self, parent, id, pos, size, choices, style, validator)  self.typedText = ''  self.log = parent.log  
self.Bind(wx.EVT_KEY_DOWN, self.OnKey)def FindPrefix(self, prefix):  self.log.WriteText('Looking for prefix: %s\n' % prefix)   if prefix:
  prefix = prefix.lower()  length = len(prefix)   # Changed in 2.5 because ListBox.Number() is no longer supported.  # 
ListBox.GetCount() is now the appropriate way to go.  for x in range(self.GetCount()):  text = self.GetString(x)  text = text.lower() 
  if text[:length] == prefix:  self.log.WriteText('Prefix %s is found.\n' % prefix)  return x   self.log.WriteText
('Prefix %s is not found.\n' % prefix)  return -1def OnKey(self, evt):  key = evt.GetKeyCode()   if key = 32 and key = 127:
  self.typedText = self.typedText + chr(key)  item = self.FindPrefix(self.typedText)   if item != -1:  self.SetSelection
(item)   elif key == wx.WXK_BACK: # backspace removes one character and backs up  self.typedText = self.typedText[:-1]   if not 
self.typedText:  self.SetSelection(0)  else:  item = self.FindPrefix(self.typedText)   if item != -1:
  self.SetSelection(item)  else:  self.typedText = ''  evt.Skip()   def OnKeyDown(self, evt):
  pass#---   class TestListBox(wx.Panel):  def __init__(self, parent, log):
  self.log = log  wx.Panel.__init__(self, parent, -1)   sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',  'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
  'twelve', 'thirteen', 'fourteen']   wx.StaticText(self, -1, This example uses the wx.ListBox control., (45, 10))  wx.StaticText
(self, -1, Select one:, (15, 50))  self.lb1 = wx.ListBox(self, 60, (100, 50), (90, 120), sampleList, wx.LB_SINGLE)  self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.lb1)
  self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, self.lb1)  self.lb1.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton)  self.lb1.SetSelection(3)  
self.lb1.Append(with data, This one has data);  self.lb1.SetClientData(2, This one has data);wx.StaticText(self, -1, Select many:, (220, 50))
  self.lb2 = wx.ListBox(self, 70, (320, 50), (90, 120), sampleList, wx.LB_EXTENDED)  self.Bind(wx.EVT_LISTBOX, self.EvtMultiListBox, self.lb2)  self.lb2.Bind(wx.EVT_RIGHT_UP
, self.EvtRightButton)  self.lb2.SetSelection(0)   sampleList = sampleList + ['test a', 'test aa', 'test aab', 'test ab', 'test abc', 'test abcc',
 'test abcd' ]  sampleList.sort()  wx.StaticText(self, -1, Find Prefix:, (15, 250))  fp = FindPrefixListBox(self, -1, (100, 250), (90, 120), sampleList, 
wx.LB_SINGLE)  fp.SetSelection(0)def EvtListBox(self, event):  self.log.WriteText('EvtListBox: %s, %s, %s, %s\n' % (
event.GetString(),  event.IsSelection(),  event.GetSelection(),  event.GetClientData())) 
  lb = event.GetEventObject()  data = "">   if data is not None:  self.log.WriteText('\tdata: %s\n' % data)
def EvtListBoxDClick(self, event):  self.log.WriteText('EvtListBoxDClick: %s\n' % self.lb1.GetSelection())  self.lb1.Delete(self.lb1.GetSelection
())   def EvtMultiListBox(self, event):  self.log.WriteText('EvtMultiListBox: %s\n' % str(self.lb2.GetSelections()))   def EvtRightButton(self, event):
  self.log.WriteText('EvtRightButton: %s\n' % event.GetPosition())   if event.GetEventObject().GetId() == 70:  selections = list(self.lb2.GetSelections
())  selections.reverse()   for index in selections:  self.lb2.Delete(index)#---
   def runTest(frame, nb, log):  win = TestListBox(nb, log)  return win   

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 standard-VGA-palette snake from my desktop. Ifyou like, you can grab them from:
http://www.doxdesk.com/img/software/py/icons.zipin .ICO format for Windows - containing all resolutions/depths up toand including Windows Vista's crazy new enormo-icons. Also contains the
vector graphics source file in Xara format. You can also see a previewhere:http://www.doxdesk.com/img/software/py/icons.png--And Clover
mailto:[EMAIL PROTECTED]http://www.doxdesk.com/--http://mail.python.org/mailman/listinfo/python-list
-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.
~Arthur Schopenhauer Please visit dimitri's website: www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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] wrote:HelloI've recently learnt python and I do love it! I congratulate all those
geeks who produce this nice language; well, because I could be called anearby newbee I've decided to improve my abilities by writing my ownnice editor with python; so I've to choose among all those GUI toolkit's
available there..But I've no idea which one I should use to start with.. I've read thattkinter seems to be the de facto standart in the pyhon community; butwhy? Is it the best available one or are theire other reasons? I read
also a litte about wxpython and pygtk.. both are appealing to me butagain to make a choice is difficult; is there also some guy liking pyqtis it worse or should it be avoided because of the licencing policy for
qt (which I also like..)?* Which one is the most fun to program with?* Which one is the most easy to learn?* Which one looks best?* Which one is the most productive to program with?
--http://mail.python.org/mailman/listinfo/python-list
-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.
~Arthur Schopenhauer Please visit dimitri's website: www.serpia.org

-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.~Arthur Schopenhauer 
Please visit dimitri's website: www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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 [EMAIL PROTECTED] wrote:
Oops...it is live. Cool!--
http://mail.python.org/mailman/listinfo/python-list-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.
~Arthur Schopenhauer Please visit dimitri's website: www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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 sure away of getting the wrong picture:A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed: [EMAIL PROTECTED] SMTP error from remote mail server after RCPT TO:
[EMAIL PROTECTED]: host serpia.org [207.210.219.100]: 550 [EMAIL PROTECTED]: Recipient address rejected: User unknown in local recipient table
Yep, I am sorry about this. But now it's working (forgot to add the webadmin mail account on my new webserver, very silly of me)Thanks,Dimitri
-- 
http://mail.python.org/mailman/listinfo/python-list

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 some web application software (HTML files,CGI/Python scripts)*locally*, must she install a full blown Apache server with all thetrimmings??Is there some easy way to somehow perhaps embed a minimal web server in
a Python tar ballor some other clever trick to make grandma's life easier?Chris--http://mail.python.org/mailman/listinfo/python-list
-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.
~Arthur Schopenhauer Please visit dimitri's website: www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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 stop this guy from posting here. Attention is what he wants, but I can't help replying to this egocentric nonsense, silly me.
Dimitri
-- 
http://mail.python.org/mailman/listinfo/python-list

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 to a site that was created in python.
thanks nige

--http://mail.python.org/mailman/listinfo/python-list
-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.~Arthur Schopenhauer 
Please visit dimitri's website: www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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 worked was usingthe MySQL-python installer(http://pythonmac.org/packages/MySQL_python-1.2.0-py2.4-macosx10.3.zip
) found at the site below.It says it is for 10.3 but I have had noproblems using it on 10.4.Hope that helps.http://pythonmac.org/packages/Adam
Steve wrote: Darwin steve.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc MacOSX 10.4.3 mysqlVer 
14.7 Distrib 4.1.14, for apple-darwin8.2.0 (powerpc) using readline 4.3 runing the software gives me steve:~/MySQL-python-1.2.0 steve$ python setup.py build running build running build_py
 creating build creating build/lib.darwin-8.3.0-Power_Macintosh-2.3 copying _mysql_exceptions.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3 creating build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb
 copying MySQLdb/__init__.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/converters.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/connections.py -
 build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/cursors.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/sets.py - build/lib.darwin-
8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/times.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/stringtimes.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb
 copying MySQLdb/mxdatetimes.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb copying MySQLdb/pytimes.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb creating build/lib.darwin-
8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/__init__.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/CR.py - build/lib.darwin-
8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/ER.py - build/lib.darwin-
8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/FLAG.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/REFRESH.py - build/lib.darwin-
8.3.0-Power_Macintosh-2.3/MySQLdb/constants copying MySQLdb/constants/CLIENT.py - build/lib.darwin-8.3.0-Power_Macintosh-2.3/MySQLdb/constants running build_ext building '_mysql' extension
 creating build/temp.darwin-8.3.0-Power_Macintosh-2.3 gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/mysql/include
 -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c _mysql.c -o build/temp.darwin-8.3.0-Power_Macintosh-2.3/_mysql.o -I/usr/local/mysql/include -Os -arch ppc64 -fno-common
 In file included from /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/Python.h:48,from pymemcompat.h:10,from _mysql.c:31:
 /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/pyport.h:554:2: error: #error LONG_BIT definition appears wrong for platform (bad gcc/glibc config?). error: command 'gcc' failed with exit status 1
 Has anyone had any experience with this problem?--http://mail.python.org/mailman/listinfo/python-list
-- All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.~Arthur Schopenhauer 
Please visit dimitri's website: www.serpia.org
-- 
http://mail.python.org/mailman/listinfo/python-list

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 -0700, SPE - Stani's Python Editor [EMAIL PROTECTED] wrote:
Hi,I'd like to thank everyone who contributed, especially Richard Brownfrom Dartware and Rick Thomas. I'm highly impressed that the smallest
user base of SPE collected the largest donation ever to SPE. Now it'smy turn to impress the SPE Mac users.As such the light is green for SPE on the Mac. First I will buy a Macand get used to it. Then I will optimize SPE for the Mac and try to
release simultaneously. Be patient as this will take some time. Thenext releases (0.7) will be based on work I did before. But from 0.8releases SPE will also be tested  developed on Mac.Please subscribe to the mailing list as a developer, user and/or mac
user. Of course donations are still welcome.Stanihttp://pythonide.stani.behttp://pythonide.stani.be/manual/html/manual.html
--http://mail.python.org/mailman/listinfo/python-list-- Some
scientists claim that hydrogen, because it is so plentiful, is the
basic building block of the universe. I dispute that. I say there is
more stupidity than hydrogen, and that is the basic building block of
the universe.-Frank Zappa-Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 list...
greetz,
dimitri

-- All truth
passes through three stages. First, it is ridiculed. Second, it is
violently opposed. Third, it is accepted as being self-evident.Arthur Schopenhauer -Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 stuff

f = StringIO.StringIO()

canvas.save(f, format=png)

# does not work in MSIE, that sucks...

return 'data:image/png,' + urllib.quote(f.getvalue())



these are DATA URIs (http://www.howtocreate.co.uk/wrongWithIE/?chapter=Data%3A+URIs)

so do I now have to change my code because most people use IE? Probably I have to :-(
Have to come up with a workaround, go back to the old input.I'mabout the only one who uses firefox in our facility.
Thanks for the reply and the link.--http://mail.python.org/mailman/listinfo/python-list-- 
All
truth passes through three stages. First, it is ridiculed. Second, it
is violently opposed. Third, it is accepted as being self-evident.Arthur Schopenhauer -Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 most of the basic stuff in a day or two. It is not as
sophisticated as Zope I suppose but I do not have the time for the
steep learning curve and my site doesn't just need it. So the choice
does depends on your requirements and the time you are willing to spend
learning it. CherryPy is very nice, try it. Run it on
http://localhost:8080 and just test it.

regards,
dimtiri-- All truth passes through three
stages. First, it is ridiculed. Second, it is violently opposed. Third,
it is accepted as being self-evident.Arthur Schopenhauer -Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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
-- 
http://mail.python.org/mailman/listinfo/python-list

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, couldn't resist
dimitri

-- 
http://mail.python.org/mailman/listinfo/python-list

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 programming in
general it might NOT be the best book to get started.

bye,
dimitri
-- 
http://mail.python.org/mailman/listinfo/python-list

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 MS-DOS Prompt I
do not know what else to do i need your help so if you could please
help. Oh and this is the second time i emailed you so please do not
send me back an automated message thank you.

-- 
___Sign-up for Ads Free at Mail.com
http://www.mail.com/?sr=signup

--http://mail.python.org/mailman/listinfo/python-list
-- All
truth passes through three stages. First, it is ridiculed. Second, it
is violently opposed. Third, it is accepted as being self-evident.Arthur Schopenhauer -Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 map(deep_list,x)

mytuple = (('Evelyn', 'Dog', 'No'),)
mylist = deep_list(mytuple)
for item in mylist:
 name, pet, modified = item
it woks fine, but I wonder if there is a better way to achieve this.
Any suggestions?

thanks,
Dimitri-- All truth passes through three stages. First, it is
ridiculed. Second, it is violently opposed. Third, it is accepted as
being self-evident.Arthur Schopenhauer -
-- 
http://mail.python.org/mailman/listinfo/python-list

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 = pattobj.searchif ps(stringtocheck):But as lots of people have already told you on this list. This should
only be used to give a warning and not prevent the use of thatparticular address.DarkCowherd--http://mail.python.org/mailman/listinfo/python-list
-- Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 tutorial. Maybe then they will think: hey, this guy (or girl)
is really doing something with his skills.

Just an idea,
DimitriOn 20 Jul 2005 05:41:39 -0700, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:hii bassically need it cuz i am appyling to colleges this year and
i know this kind of stuff really helps.besides since i am learning python i thought i might get some creditfor it as well.its bassically for a mention in my resume/bio-data/appliccationi am willing to spend about $50-100 but any more is out of my bugdet.
even $50 is hard on me.i did find this great site that wouldlet me give a perl exam in $9.99but they don't have python.--http://mail.python.org/mailman/listinfo/python-list
-- All
truth passes through three stages. First, it is ridiculed. Second, it
is violently opposed. Third, it is accepted as being self-evident.Arthur Schopenhauer -Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 consider the Python Cookbook next to Dive into
Python.
(on the other hand, since you can download Dive into Python you can try if it works for you)
Bye,
DimitriOn 7/5/05, Sybren Stuvel [EMAIL PROTECTED] wrote:
Lennart enlightened us with: Can someone advice me with the following issue: i want to learn
 python in my summer vacation (i try to ...:-) So, a good start is buying a good book.But wich? There are many ...http://www.diveintopython.org/ - I read it during the weekend, and
it's a very good book. Clearly written, good examples and a healthydose of humor. I'm living in the Netherlands and I prefer a book from bol.com (see link) because i've to order more books by them.
Dive Into Python can be freely downloaded. Search here for python (sorry, there's no short link)Yes there is. Check http://tinyurl.com/Sybren--
The problem with the world is stupidity. Not saying there should be acapital punishment for stupidity, but why don't we just take thesafety labels off of everything and let the problem solve itself?
Frank Zappa--http://mail.python.org/mailman/listinfo/python-list-- Please visit dimitri's website: 
www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 database.when i enter this: db = MySQLdb.connect(user=user, passwd=pass,db=myDB)i get this:
Traceback (most recent call last):File pyshell#1, line 1, in -toplevel-db = MySQLdb.connect(user=user, passwd=pass, db=MyDB)File /usr/lib/python2.4/site-packages/MySQLdb/__init__.py, line 66,
in Connectreturn Connection(*args, **kwargs)File /usr/lib/python2.4/site-packages/MySQLdb/connections.py, line134, in __init__super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (1049, Unknown database 'MyDB')i am using the all in one package from lampp (now xampp) and i havetested a couple of python scripts from the cgi, but nothing thatconnects to the database.
any ideas?thanks--http://mail.python.org/mailman/listinfo/python-list-- Please visit dimitri's website: 
www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 sister, but at least she is not a guy. i am.'
b = a.replace('. ', '.')
splitlist = b.split('.')
newlist = []
for i in range(len(splitlist)):
 i = ''.join(splitlist[i].capitalize() + '.'
 newlist.append(i)
cap = ' '.join(newlist).replace(' .', '')
print cap

and it prints : Harry is a strange guy. So is his sister, but at least she is not a guy. I am.

But I wonder if there is a easier way to accomplish this. For instance it doesn't work with:
is harry a strange guy? so is his sister, but at least she is not a guy. i am.

any suggestions?

Thanks,Dimitri-- Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 [EMAIL PROTECTED] wrote:
Hello.I am new to this list, but wondered if anyone could help me.I have hadPython set up with PMW and BLT on two machines previous to my currentlaptop, but I can't seem to get them all to work together on this
machine.It may be the version of python (2.4, with TCL 8.4) that I haveinstalled since I had older version on the other machines.Anyway - can anyone give me suggestions of how to get BLT towork?(versions: python 
2.4, Tcl 8.4, BLT 2.4) I have run the BLTinstaller, copied the dlls into the tcl/bin directory and added thatdirectory to my path.Still the demos don't recognize BLT as being installed.Alternatively - what would be the best graphics extension to learn in place
of BLT if, as it seems, BLT is not supported by anyone any longer.thank you,Ali--http://mail.python.org/mailman/listinfo/python-list
-- Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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 it difficult to display data from a dictionary using GUI.What widget should I use? I tried using text widget, but I couldn't getthe display I want. I need the display to look like thisfile
name
size
agelocationfdssfdfsa
3034safasfafsfdsaasdfafdsafs
4556asdffdsafsdAnd I'm getting the display from inside a dictionary that holds list asits value. Any suggestion on what I should use to display the data inthat format??--
http://mail.python.org/mailman/listinfo/python-list-- Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

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,


 labelpos = 'n',


 label_text = 'Database',


 vertflex=elastic)


 self.frame1.pack(fill=both, expand=1)


/snip





/snip


 columns = tuple([x[0:1] for x in fg.fields])


 columns2 = tuple([x+(15,) for x in columns])


 


 self.mlb = MultiLB.MultiListbox(self.frame1.interior(), columns2)


 


 for i in range(len(fg.data)):


 self.mlb.insert(end, fg.data[i])


 


 self.mlb.pack(expand=1, fill=both) 


/snip





the horizontal scrollbar is displayed correctly, but the vertical
scrollbar is only visible when you scroll to the far right side of the
screen.


So, apparently it is added to the last listbox in stead of to the scrolledframe itself.


 

Any suggestions, anyone?
(btw, I also posted this to the tkinter mailing list but it bounced. Is this list inactive?)


Thanks!

Dimitri

-- 
http://mail.python.org/mailman/listinfo/python-list

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
-- 
http://mail.python.org/mailman/listinfo/python-list

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 regards,
Dimitri

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: nested tuple slice

2005-04-12 Thread dimitri pater
Thanks,
I have been trying this:

tuple = (('goat', 90, 100), ('cat', 80, 80), ('platypus', 60, 800))

index = 0
newtuple = ()
for item in tuple:
 newtuple = newtuple + tuple[index][0:2]
 index += 1
 
print newtuple
but it returns:
('goat', 90, 'cat', 80, 'platypus', 60)
which is no longer nested, and I need a nested tuple

DimitriOn Apr 12, 2005 11:53 PM, Leeds, Mark [EMAIL PROTECTED] wrote:














maybe list(tuple)[0:2])) will

get you what you

want but I don't know how to

change it back to a tuple.

I'm just starting out but

I would be interested also.




mark



-Original 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, 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 regards,
Dimitri










-- Please visit dimitri's website: www.serpia.com-- 
http://mail.python.org/mailman/listinfo/python-list

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 simple file upload CGI.  I'm on a Windows server.
 I *am* using the -u switch to start Python for CGIs, as follows:
 
 c:\python\python.exe -u %s %s
 
 I *do* have write permissions on the directory I'm trying to write to.  But,
 when I click submit, it just hangs.  Any help would be greatly appreciated.
 Thanks.  Here's the code...
 
 Upload.py
 
 import cgi
 
 print content-type: text/html\n\n
 
 form = cgi.FieldStorage()
 if not form:
   print 
 html
 head/head
 body
 form name=frmMain action=Upload.py method=POST
 enctype=multipart/form-data
 input type=file name=filenamebr
 input type=submit
 /form
 /body
 /html
 
 else:
   import BLOB
   lobjUp = BLOB.BLOB()
   if lobjUp.Save('filename', 'SomeFile.jpg'):
 print 
 html
 head/head
 body
   File successfully saved.
 /body
 /html
 
   else:
 print 
 html
 head/head
 body
   Unable to save file.
 /body
 /html
 
 
 --
 
 Blob.py
 
 import cgi
 import staticobject
 
 cTrue = 1
 cFalse = 0
 
 try:
   import msvcrt,os
   msvcrt.setmode( 0, os.O_BINARY ) # stdin  = 0
   msvcrt.setmode( 1, os.O_BINARY ) # stdout = 1
 except ImportError:
   pass
 
 class BLOB(staticobject.StaticObject):
 
   def __init__(self):
 self.initializing = cTrue
 staticobject.StaticObject.__init__(self)
 self.initializing = cFalse
 
   def Save(self, pstrFormFieldName, pstrFilePathAndName):
 
 # tried this first -- same result -- just hangs...
 #try:
 #  form = cgi.FieldStorage()
 #  item = form[pstrFormFieldName]
 #  if item.file:
 #data = item.file.read()
 #f = open(pstrFilePathAndName,'wb')
 #f.write(data)
 #f.close()
 #return cTrue
 #  else:
 #return cFalse
 #except:
 #  return cFalse
 
 form = cgi.FieldStorage()
 f = open(pstrFilePathAndName,'wb')
 f.write(form[pstrFormFieldName].value)
 f.close()
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: File Uploads

2005-03-27 Thread dimitri pater
No, I am on a Linux server. I am not sure how CGI is configured
because I do not control the server, I only use it.

bye,
Dimitri


On Sun, 27 Mar 2005 16:19:00 -0700, Doug Helm [EMAIL PROTECTED] wrote:
 Thanks, Dimitri.  Yes, I found that same code too and tried it with the
 exact same result 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:[EMAIL PROTECTED]
  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 simple file upload CGI.  I'm on a Windows
 server.
   I *am* using the -u switch to start Python for CGIs, as follows:
  
   c:\python\python.exe -u %s %s
  
   I *do* have write permissions on the directory I'm trying to write to.
 But,
   when I click submit, it just hangs.  Any help would be greatly
 appreciated.
   Thanks.  Here's the code...
  
   Upload.py
  
   import cgi
  
   print content-type: text/html\n\n
  
   form = cgi.FieldStorage()
   if not form:
 print 
   html
   head/head
   body
   form name=frmMain action=Upload.py method=POST
   enctype=multipart/form-data
   input type=file name=filenamebr
   input type=submit
   /form
   /body
   /html
   
   else:
 import BLOB
 lobjUp = BLOB.BLOB()
 if lobjUp.Save('filename', 'SomeFile.jpg'):
   print 
   html
   head/head
   body
 File successfully saved.
   /body
   /html
   
 else:
   print 
   html
   head/head
   body
 Unable to save file.
   /body
   /html
   
  
   --
  
   Blob.py
  
   import cgi
   import staticobject
  
   cTrue = 1
   cFalse = 0
  
   try:
 import msvcrt,os
 msvcrt.setmode( 0, os.O_BINARY ) # stdin  = 0
 msvcrt.setmode( 1, os.O_BINARY ) # stdout = 1
   except ImportError:
 pass
  
   class BLOB(staticobject.StaticObject):
  
 def __init__(self):
   self.initializing = cTrue
   staticobject.StaticObject.__init__(self)
   self.initializing = cFalse
  
 def Save(self, pstrFormFieldName, pstrFilePathAndName):
  
   # tried this first -- same result -- just hangs...
   #try:
   #  form = cgi.FieldStorage()
   #  item = form[pstrFormFieldName]
   #  if item.file:
   #data = item.file.read()
   #f = open(pstrFilePathAndName,'wb')
   #f.write(data)
   #f.close()
   #return cTrue
   #  else:
   #return cFalse
   #except:
   #  return cFalse
  
   form = cgi.FieldStorage()
   f = open(pstrFilePathAndName,'wb')
   f.write(form[pstrFormFieldName].value)
   f.close()
  
   --
   http://mail.python.org/mailman/listinfo/python-list
  
 
 
  --
  Please visit dimitri's website: www.serpia.com
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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

#!/usr/bin/env python
import wx
import wx.grid
import getdata
# getdata.py is a module I wrote to connect to the MySQL database, it works

db = getdata.Eb_db(www.serpia.com, gedrag5)

class MyFrame(wx.Frame):
   def __init__(self, *args, **kwds):
   kwds[style] = wx.DEFAULT_FRAME_STYLE
   wx.Frame.__init__(self, *args, **kwds)
   self.notebook_1 = wx.Notebook(self, -1, style=0)
   self.notebook_1_pane_2 = wx.Panel(self.notebook_1, -1)
   self.notebook_1_pane_1 = wx.Panel(self.notebook_1, -1)
   self.label_1 = wx.StaticText(self.notebook_1_pane_1, -1, Input)
   self.text_ctrl_1 = wx.TextCtrl(self.notebook_1_pane_1, -1, )
   self.button_1 = wx.Button(self.notebook_1_pane_1, -1, submit)
   self.button_2 = wx.Button(self.notebook_1_pane_2, -1, refresh)
   self.grid_1 = wx.grid.Grid(self.notebook_1_pane_2, -1, size=(1, 1))

   self.__set_properties()
   self.__do_layout()
   # create an event for button_2
   wx.EVT_BUTTON(self, self.button_2.GetId(), self.fillGrid)

   def __set_properties(self):
   self.SetTitle(frame_1)
   self.SetSize((400, 400))

   def fillGrid(self, event):
   # fill grid with data from database
   self.grid_1.CreateGrid(len(db.data), len(db.fields))
   index = 0
   for item in db.fields:
   self.grid_1.SetColLabelValue(index, item[0])
   index += 1

   for row in range(len(db.data)):
   for col in range(len(db.data[row])):
   value = db.data[row][col]
   self.grid_1.SetCellValue(row,col,value)

   def __do_layout(self):
   sizer_1 = wx.BoxSizer(wx.VERTICAL)
   grid_sizer_3 = wx.GridSizer(2, 1, 0, 0)
   grid_sizer_2 = wx.GridSizer(2, 2, 0, 0)
   grid_sizer_2.Add(self.label_1, 0, wx.FIXED_MINSIZE, 0)
   grid_sizer_2.Add(self.text_ctrl_1, 0, wx.FIXED_MINSIZE, 0)
   grid_sizer_2.Add(self.button_1, 0, wx.FIXED_MINSIZE, 0)
   self.notebook_1_pane_1.SetAutoLayout(True)
   self.notebook_1_pane_1.SetSizer(grid_sizer_2)
   grid_sizer_2.Fit(self.notebook_1_pane_1)
   grid_sizer_2.SetSizeHints(self.notebook_1_pane_1)
   grid_sizer_3.Add(self.button_2, 0, wx.FIXED_MINSIZE, 0)
   grid_sizer_3.Add(self.grid_1, 1, wx.EXPAND, 0)
   self.notebook_1_pane_2.SetAutoLayout(True)
   self.notebook_1_pane_2.SetSizer(grid_sizer_3)
   grid_sizer_3.Fit(self.notebook_1_pane_2)
   grid_sizer_3.SetSizeHints(self.notebook_1_pane_2)
   self.notebook_1.AddPage(self.notebook_1_pane_1, Output)
   self.notebook_1.AddPage(self.notebook_1_pane_2, Input)
   sizer_1.Add(wx.NotebookSizer(self.notebook_1), 1, wx.EXPAND, 0)
   self.SetAutoLayout(True)
   self.SetSizer(sizer_1)
   self.Layout()

if __name__ == __main__:
   app = wx.PySimpleApp(0)
   wx.InitAllImageHandlers()
   frame_1 = MyFrame(None, -1, )
   app.SetTopWindow(frame_1)
   frame_1.Show()
   app.MainLoop()

As you can see, I use button_2 on the second pane of the notebook to
fill the grid. But what I really want to do is to click on the pane
itself to update the grid.
And there is another problem, when I use button_2 , it works only
once. I get the following error:
C++ assertion wxAssertFailure failed in
../src/generic/grid.cpp(4018): wxGrid::CreateGrid or wxGrid::SetTable
called more than once.
I think maybe I should destroy the grid first, but I don't know how to
do this properly. I 've tried several things.

I hope that I explained my problem well enough and that somebody can
give some clues on how to solve this.
-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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 developing Applications too
 rapidly as ppls used to work on win32 platform with VB.
 
 http://www40.brinkster.com/s4somesh/glade/index.html
 
 somesh
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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 more than
happy to host the tutorials *and* help you with writing them.

bye,
Dimtiri


On Fri, 04 Mar 2005 08:21:16 -0600, adamc [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 2005-03-04, 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 developing Applications too
  rapidly as ppls used to work on win32 platform with VB.
 
  http://www40.brinkster.com/s4somesh/glade/index.html
 
 
  somesh
 
 Somesh,
 
 I've been meaning to start a small simple collection of documents that
 teaches the basics of python to younger (age 7-12) children. I have
 two kids who aren't yet old enough to read properly (although they've
 made a start) but I want to get some basic docs ready for when they're
 ready to start.
 
 I've looked around at other docs, but I don't think that they are great
 for ordinary kids of this age (but I'm sure some will get something out
 of it). The docs I want to produce will run in small chunks but with
 quick resultsi, heavy on screenshots (where applicable) and have a
 younger look and feel about them than some of the official documents.
 All the documents should also be supported by face-to-face interaction
 (like a day programming with dad!)
 
 I notice that your documents are specific to gui creation and glade,
 and I'm not sure how old your brother is, but do you want to collaborate
 on this? Anyone else think this might be worth while distributing?
 
 Adam
 
 - --
 http://www.monkeez.org
 PGP key: 7111B833
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.0 (GNU/Linux)
 
 iD8DBQFCKG7TLeLM1Z6tVakRAiUSAJ9yaxNBk0YnqB7ES20eMLKL6U1ymACfcSHA
 VCZ81mc86bS0wK39ah/as5U=
 =dhNY
 -END PGP SIGNATURE-
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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 myprogram.exe with py2exe,but how to start fullscreen ?
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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 'hello.pdf' works, but 'hello
there.pdf' is displayed as hello).
The filenames are displayed correctly in the main page of the browser.
I tried several things, maybe somebody knows how to do it?

script: (sorry for the long list)

#! /usr/bin/python

import os, sys
import cgi
print Content-type: text/html
print
print pre

try:
import cgitb
cgitb.enable()
except:
sys.stderr = sys.stdout

print /pre

def walktree(top = ../upload, depthfirst = True):
import os, stat, types
names = os.listdir(top)
if not depthfirst:
yield top, names
for name in names:
try:
st = os.lstat(os.path.join(top, name))
except os.error:
continue
if stat.S_ISDIR(st.st_mode):
for (newtop, children) in walktree (os.path.join(top,
name), depthfirst):
yield newtop, children
if depthfirst:
yield top, names

def makeHTMLtable(top, depthfirst=False):
from xml.sax.saxutils import escape # To quote out things like amp;
ret = ['table class=fileList\n']
for top, names in walktree(top):
ret.append('   trtd class=directory%s/td/tr\n'%escape(top))
for name in names:
ret.append('   trtd class=filea
href=http://e-bench.serpia.com/upload/%s%s/a/td/tr\n' %
(escape(name),escape(name)))
ret.append('/table')
return ''.join(ret) # Much faster than += method

def makeHTMLpage(top, depthfirst=False):
return '\n'.join(['!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN',
  'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;',
  'html'
  'head',
  '   titleSearch results/title',
  '   style type=text/css',
  '  table.fileList { text-align: left; }',
  '  td.directory { font-weight: bold; }',
  '  td.file { padding-left: 4em; }',
  '   /style',
  '/head',
  'body',
  'h1Documenten e-bench/h1',
  makeHTMLtable(top, depthfirst),
  'BRBRHRBA
HREF=http://e-bench.serpia.com;Home/A/B',
  'h5To do: escape chars verwijderen/h5',
  'h5.../h5',
  'h5Aparte HTML template maken als in upload.py/h5',
  '/body',
  '/html'])
   
if __name__ == '__main__':
if len(sys.argv) == 2:
top = sys.argv[1]
else: top = '.'
print makeHTMLpage('../upload')

-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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
 news:[EMAIL PROTECTED]
 
  The problem is that the filenames are cut off in the status bar of the
  browser because of the white space (eg 'hello.pdf' works, but 'hello
  there.pdf' is displayed as hello).
 
 urllib.quote() should do the trick. You need to follow the rules for
 encoding URIs as well as the HTML ones.
 
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


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
-- 
http://mail.python.org/mailman/listinfo/python-list


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 using PythonWin atm, but
 I'd like something with more functionality.
 
 Chris
 --
 http://mail.python.org/mailman/listinfo/python-list
 


-- 
Please visit dimitri's website: www.serpia.com
-- 
http://mail.python.org/mailman/listinfo/python-list