[Tutor] doc string format ?

2008-06-08 Thread dave selby
Hi All, I am trying to improve my code quality and have started using doc strings. What format do you guys use for your doc strings ? I have 'made up' the following general format ... Cheers Dave def gen_vhost(kmotion_dir): """ Generate the kmotion vhost file from vhost_template expan

Re: [Tutor] zip and rar files

2008-06-08 Thread Dinesh B Vadhia
the zipfile module does work or rar zip archives. - Original Message - From: Dinesh B Vadhia To: tutor@python.org Sent: Saturday, June 07, 2008 8:27 AM Subject: zip and rar files Does the Python zipfile module work on rar archives? If not, does a similar module exist for rar archiv

[Tutor] Why not to use include?

2008-06-08 Thread Dotan Cohen
I am moving a website from php to python gradually. The first step is replacing the page headers and footers. Currently, each page begins with which contains the porton of the html and the html code to present the website name and logo. Each page ends with which includes a footer note and the cl

Re: [Tutor] doc string format ?

2008-06-08 Thread Kent Johnson
On Sun, Jun 8, 2008 at 4:54 AM, dave selby <[EMAIL PROTECTED]> wrote: > Hi All, > > I am trying to improve my code quality and have started using doc > strings. What format do you guys use for your doc strings ? PEP 257 has some general recommendations: http://www.python.org/dev/peps/pep-0257/ Th

Re: [Tutor] Why not to use include?

2008-06-08 Thread Kent Johnson
On Sun, Jun 8, 2008 at 6:46 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > I am moving a website from php to python gradually. The first step is > replacing the page headers and footers. I'm not sure how you plan to do this. PHP programs are embedded into web pages. Python web programs output the co

Re: [Tutor] Why not to use include?

2008-06-08 Thread Dotan Cohen
2008/6/8 Kent Johnson <[EMAIL PROTECTED]>: > On Sun, Jun 8, 2008 at 6:46 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: >> I am moving a website from php to python gradually. The first step is >> replacing the page headers and footers. > > I'm not sure how you plan to do this. PHP programs are embedded

Re: [Tutor] doc string format ?

2008-06-08 Thread Marilyn Davis
On Sun, June 8, 2008 1:54 am, dave selby wrote: > Hi All, > > > I am trying to improve my code quality and have started using doc > strings. What format do you guys use for your doc strings ? I have 'made > up' the following general format ... Your made-up format looks good. It's great that you

[Tutor] handling MIDI in python

2008-06-08 Thread amit sethi
Can someone tell me about the libraries that can handle MIDI files and also is their a way in which I can convert an mp3 and wav file into a Midi file within a python program -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/

Re: [Tutor] Why not to use include?

2008-06-08 Thread Andreas Kostyrka
On Sunday 08 June 2008 17:13:21 Dotan Cohen wrote: > 2008/6/8 Kent Johnson <[EMAIL PROTECTED]>: > > On Sun, Jun 8, 2008 at 6:46 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > >> I am moving a website from php to python gradually. The first step is > >> replacing the page headers and footers. > > > >

Re: [Tutor] Why not to use include?

2008-06-08 Thread Kent Johnson
On Sun, Jun 8, 2008 at 11:13 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > Very little of the pages are PHP, most is HTML. I understand that > Python can be used as a web scripting language, so I assume that > Python can be run in Apache from a page with an .html extension. Is > this not the case, w

Re: [Tutor] handling MIDI in python

2008-06-08 Thread Anthony Parks
regarding conversion between wav and midi, ive looked into it. like the following article says, you can't. http://www.hitsquad.com/smm/news/9903_101/ i mean, it is possible, but wav and midi are fundamentally different things. midi files contain commands that play sounds based on software synthesi

Re: [Tutor] Why not to use include?

2008-06-08 Thread Dotan Cohen
2008/6/8 Andreas Kostyrka <[EMAIL PROTECTED]>: >> Very little of the pages are PHP, most is HTML. I understand that >> Python can be used as a web scripting language, so I assume that >> Python can be run in Apache from a page with an .html extension. Is >> this not the case, with an .httaccess dir

Re: [Tutor] Why not to use include?

2008-06-08 Thread Dotan Cohen
2008/6/8 Andreas Kostyrka <[EMAIL PROTECTED]>: >> Very little of the pages are PHP, most is HTML. I understand that >> Python can be used as a web scripting language, so I assume that >> Python can be run in Apache from a page with an .html extension. Is >> this not the case, with an .httaccess dir

[Tutor] Adding ctypes to an application with python 2.2

2008-06-08 Thread S. Doron
Hello, I'm new to this list. What I'd like to do is add support for pointers to an old version of python (2.2) in an existing application (a game). Searching around the web, I found the ctypes module which is supposed to add this capability to python. However, I didn't quite understand if and how t

Re: [Tutor] Why not to use include?

2008-06-08 Thread Michael Langford
Python makes web pages just fine. There are both embedded technologies (such as the python server pages Kent mentioned above) and template engines based on callbacks (such as django's templates, djangos the whole way, etc). Its extremely easy to make your own templating engine if you don't like py

Re: [Tutor] Why not to use include?

2008-06-08 Thread Kent Johnson
On Sun, Jun 8, 2008 at 3:14 PM, Dotan Cohen <[EMAIL PROTECTED]> wrote: > If this is not the case, then why are there so many "PHP vs. Python" > flame wars? PHP is designed for _only_ programming web pages, so far > as I understand, so if Python cannot do that why are the two languages > compared so

Re: [Tutor] Why not to use include?

2008-06-08 Thread Dotan Cohen
2008/6/8 Michael Langford <[EMAIL PROTECTED]>: > Python makes web pages just fine. There are both embedded technologies > (such as the python server pages Kent mentioned above) and template > engines based on callbacks (such as django's templates, djangos the > whole way, etc). > > Its extremely ea

Re: [Tutor] Why not to use include?

2008-06-08 Thread Dotan Cohen
2008/6/8 Kent Johnson <[EMAIL PROTECTED]>: > On Sun, Jun 8, 2008 at 3:14 PM, Dotan Cohen <[EMAIL PROTECTED]> wrote: >> If this is not the case, then why are there so many "PHP vs. Python" >> flame wars? PHP is designed for _only_ programming web pages, so far >> as I understand, so if Python cannot

[Tutor] Extracting text from XML document

2008-06-08 Thread Dinesh B Vadhia
I want to extract text from XML (and SGML) documents. I found one program by Paul Prescod (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65128) from 2001. Does anyone know of any programs that are more recent? Cheers Dinesh ___ Tutor maill

Re: [Tutor] Adding ctypes to an application with python 2.2

2008-06-08 Thread Alan Gauld
"S. Doron" <[EMAIL PROTECTED]> wrote Hello, I'm new to this list. What I'd like to do is add support for pointers to an old version of python (2.2) in an existing application (a game). What do you mean by "add support for pointers"? Pointers are a very low level memory specific thing in C. In

Re: [Tutor] Extracting text from XML document

2008-06-08 Thread Kent Johnson
On Sun, Jun 8, 2008 at 6:39 PM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > I want to extract text from XML (and SGML) documents. I found one program > by Paul Prescod > (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65128) from 2001. > Does anyone know of any programs that are more rec