Python3: API Documentation generator

2010-09-26 Thread Tim Diels
Hi all I've just switched to python3 and it turns out my current API documentation generator (epydoc) no longer works. I am looking for a tool that reads the docstrings of all classes, ... in my project and turns it into HTML documentation. Thanks for your time limyreth -- http://mail.pyth

Re: sequence multiplied by -1

2010-09-26 Thread Steven D'Aprano
On Sun, 26 Sep 2010 09:30:08 +, Seebs wrote: >> There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", >> and the fact that it doesn't do the same thing as int("spam")*3 is a >> foolish argument. > > The languages in which it's surprising are mostly things like perl, > where

Re: sequence multiplied by -1

2010-09-26 Thread Steven D'Aprano
On Sun, 26 Sep 2010 01:16:49 -0700, Paul Rubin wrote: > Steven D'Aprano writes: >> There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", > Why would it not be ["spam","spam","spam"] or even "ssspppaaammm"? The first one would be a reasonable design choice, although less useful

Re: Errors with PyPdf

2010-09-26 Thread Dave Angel
On 2:59 PM, flebber wrote: Traceback (most recent call last): File "C:/Python26/Pdfread", line 16, in open('x.txt', 'w').write(content) NameError: name 'content' is not defined When i use. import pyPdf def getPDFContent(path): content =C:\Components-of-Dot-NET.txt" # Load P

Simple interface to minidom for creating XML files

2010-09-26 Thread Raphaël Plasson
Hello, I want to create some XML files, following a simple template. For that purpose, I created a simple interface to minidom. This is simple code, but as I spend a little time for understanding how minidom was working, I thought that this may be useful for someone (not that minidom is complex, b

Re: Calling an arbitrary function with the right arguments

2010-09-26 Thread Chris Rebert
On Sun, Sep 26, 2010 at 8:41 PM, John O'Hagan wrote: > How to call a function with the right arguments without knowing in advance > which function? For example: > > import random > > def f1(): >    pass > > def f2(foo): >    pass > > def f3(foo, bar): >    pass > > foo=random.choice((1,2,3)) > bar

Re: Calling an arbitrary function with the right arguments

2010-09-26 Thread Steven D'Aprano
On Mon, 27 Sep 2010 03:41:13 +, John O'Hagan wrote: > How to call a function with the right arguments without knowing in > advance which function? For example: > > import random > > def f1(): > pass > > def f2(foo): > pass > > def f3(foo, bar): > pass > > foo=random.choice((1

Calling an arbitrary function with the right arguments

2010-09-26 Thread John O'Hagan
How to call a function with the right arguments without knowing in advance which function? For example: import random def f1(): pass def f2(foo): pass def f3(foo, bar): pass foo=random.choice((1,2,3)) bar=random.choice((1,2,3)) myfunc=random.choice((f1, f2, f3)) How to call myfu

Re: Errors with PyPdf

2010-09-26 Thread Tim Roberts
flebber wrote: > >okay thanks I thought that when I set content here > >def getPDFContent(path): >content = "C:\Components-of-Dot-NET.pdf" You have a backslash problem here. You need need to say: content = "C:\\Components-of-Dot-NET.pdf" or content = "C:/Components-of-Dot-NET.pdf" or

Re: Errors with PyPdf

2010-09-26 Thread flebber
On Sep 27, 12:49 pm, MRAB wrote: > On 27/09/2010 01:39, flebber wrote: > > > > > On Sep 27, 9:38 am, "w.g.sned...@gmail.com" > > wrote: > >> On Sep 26, 7:10 pm, flebber  wrote: > > >>> I was trying to use Pypdf following a recipe from the Activestate > >>> cookbooks. However I cannot get it too wo

Re: Errors with PyPdf

2010-09-26 Thread MRAB
On 27/09/2010 01:39, flebber wrote: On Sep 27, 9:38 am, "w.g.sned...@gmail.com" wrote: On Sep 26, 7:10 pm, flebber wrote: I was trying to use Pypdf following a recipe from the Activestate cookbooks. However I cannot get it too work. Unsure if it is me or it is beacuse sets are deprecated.

Re: Errors with PyPdf

2010-09-26 Thread flebber
On Sep 27, 12:08 pm, flebber wrote: > On Sep 27, 10:39 am, flebber wrote: > > > > > On Sep 27, 9:38 am, "w.g.sned...@gmail.com" > > wrote: > > > > On Sep 26, 7:10 pm, flebber wrote: > > > > > I was trying to use Pypdf following a recipe from the Activestate > > > > cookbooks. However I cannot g

Re: Errors with PyPdf

2010-09-26 Thread flebber
On Sep 27, 10:39 am, flebber wrote: > On Sep 27, 9:38 am, "w.g.sned...@gmail.com" > wrote: > > > > > On Sep 26, 7:10 pm, flebber wrote: > > > > I was trying to use Pypdf following a recipe from the Activestate > > > cookbooks. However I cannot get it too work. Unsure if it is me or it > > > is b

Re: Python 2.7 installation problem

2010-09-26 Thread Ronald Guida
Sorry, I have one additional piece of information that might be helpful to others. I have discovered that the *.so files that were not installed, were actually installed to the ~/lib/python2.6/ folder instead of the ~/lib/python2.7/ folder where they belong. On Sun, Sep 26, 2010 at 9:25 PM, Ronal

Re: Python 2.7 installation problem

2010-09-26 Thread Ronald Guida
Solved -- "make install" failed to actually install a subset of files. I had to manually copy them instead. Specifics: I started from /home/oddron/installers/python/Python-2.7/ and executed the usual commands: $ ./configure --prefix=$HOME $ make $ make install I have found that the installer fai

Re: Problems reading tif files

2010-09-26 Thread Christian Heimes
Am 27.09.2010 02:31, schrieb gujax: > Hi, > I have read several related e-mails dating back as far as 2006. I am > quite confused whether PIL can open tif images. Some posts seem to say > there isn't yet any support for PIL while there are few posts where > PIL has been able to open tif images. So

Re: Errors with PyPdf

2010-09-26 Thread flebber
On Sep 27, 9:38 am, "w.g.sned...@gmail.com" wrote: > On Sep 26, 7:10 pm, flebber wrote: > > > I was trying to use Pypdf following a recipe from the Activestate > > cookbooks. However I cannot get it too work. Unsure if it is me or it > > is beacuse sets are deprecated. > > > I have placed a pdf i

Problems reading tif files

2010-09-26 Thread gujax
Hi, I have read several related e-mails dating back as far as 2006. I am quite confused whether PIL can open tif images. Some posts seem to say there isn't yet any support for PIL while there are few posts where PIL has been able to open tif images. So I guess, I have to ask this probably trivial q

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Ertugrul Söylemez
Ertugrul Söylemez wrote: > In Haskell the solution looks like this: > > [...] And before anyone starts to rant, I didn't pay attention to where I'm X-posting this stuff. Sorry for that. But on the other hand you could say that I'm giving the Perl people (apparently the only people feeling the

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Ertugrul Söylemez
Xah Lee wrote: > here's a interesting toy list processing problem. > > I have a list of lists, where each sublist is labelled by a number. I > need to collect together the contents of all sublists sharing the same > label. So if I have the list > > ((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2 k l)

Re: Errors with PyPdf

2010-09-26 Thread w.g.sned...@gmail.com
On Sep 26, 7:10 pm, flebber wrote: > I was trying to use Pypdf following a recipe from the Activestate > cookbooks. However I cannot get it too work. Unsure if it is me or it > is beacuse sets are deprecated. > > I have placed a pdf in my C:\ drive. it is called "Components-of-Dot- > NET.pdf" You

Re: Errors with PyPdf

2010-09-26 Thread MRAB
On 27/09/2010 00:10, flebber wrote: I was trying to use Pypdf following a recipe from the Activestate cookbooks. However I cannot get it too work. Unsure if it is me or it is beacuse sets are deprecated. The 'sets' module pre-dates the built-in 'set' class. The warning is just to inform you tha

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Rhodri James
On Sun, 26 Sep 2010 23:16:24 +0100, Jürgen Exner wrote: I have solved my problems with Xah years ago, that's what killfiles are for. And I have no idea why you are bringing up Xah in your current rant. It was livibetter who without any motivation or reasoning posted Python code in CLPM. If a

Errors with PyPdf

2010-09-26 Thread flebber
I was trying to use Pypdf following a recipe from the Activestate cookbooks. However I cannot get it too work. Unsure if it is me or it is beacuse sets are deprecated. I have placed a pdf in my C:\ drive. it is called "Components-of-Dot- NET.pdf" You could use anything I was just testing with it.

Re: Unicode usenet posting. This is a test.

2010-09-26 Thread Xah Lee
On Sep 26, 5:40 am, Spiros Bousbouras wrote: > > And just for good measure, some «European style quotes» and “balanced smart > > quotes” which I intend some day to try to convince people to start using > > to eliminate the scourge of backslash escapes.  But that's a topic for > > another day. > >

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Bakul Shah
On 9/25/10 9:05 PM, Xah Lee wrote: here's a interesting toy list processing problem. I have a list of lists, where each sublist is labelled by a number. I need to collect together the contents of all sublists sharing the same label. So if I have the list ((0 a b) (1 c d) (2 e f) (3 g h) (1 i j)

xml.etree - why no HTMLTreeBuilder included?

2010-09-26 Thread Jon P.
It is great that Fredrik Lundh's ElementTree is now a part of the Python Standard Library. However, Is it correct that if you want to use xml.etree.ElementTree to parse an HTML Document that you will have to install a separate HTMLTreeBuilder (e.g. TidyHTMLTreeBuilder) and that the only TreeBuilde

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Xah Lee
On Sep 26, 7:56 am, Sherm Pendley wrote: > Jürgen Exner writes: > > Alexander Burger wrote: > >>In PicoLisp: > > > What the f does PicoLisp have to with Perl? > > It's Xah. He cross-posts in an attempt to start a language feud. > > Please don't feed the troll. sorry i disagree. And please d

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Xah Lee
2010-09-26 On Sep 25, 11:17 pm, Paul Rubin wrote: > Python solution follows (earlier one with an error cancelled).  All > crossposting removed since crossposting is a standard trolling tactic. > >     from collections import defaultdict > >     def collect(xss): >         d = defaultdict(list) >

Re: sequence multiplied by -1

2010-09-26 Thread Arnaud Delobelle
Paul Rubin writes: > Seebs writes: >> * It seems clear that, given two sequences x and y, "x + y" ought to >> be the concatenation of these sequences. >>... >> Helps, perhaps, that I got exposed to group theory early enough to be used >> to redefining + and * to be any two operations which hav

Re: creating python daemon ?

2010-09-26 Thread vineet daniel
On Sep 26, 2:20 pm, Stefan Schwarzer wrote: > Hi Daniel, > > On 2010-09-23 07:30, vineet daniel wrote: > > > > > On Sep 22, 2:20 pm, de...@web.de (Diez B. Roggisch) wrote: > >> vineet daniel writes: > >>> On Sep 21, 9:47 pm, de...@web.de (Diez B. Roggisch) wrote: > vineet daniel writes: > >

Re: toy list processing problem: collect similar terms

2010-09-26 Thread John Bokma
Jürgen Exner writes: > livibetter wrote: >>Here is mine for Python: > > What the f*** does Python have to do with Perl? Clueless fuck. I unsubscribed from comp.lang.perl.misc to avoid the retards like you and now you come in via the backdoor. If you have a problem with Xah report him with Googl

Re: Python2.7 on OSX

2010-09-26 Thread Jonas Galvez
Bingo, that was it. Thanks! -- Jonas On Sat, Sep 25, 2010 at 4:05 PM, Shashwat Anand wrote: > > > On Sun, Sep 26, 2010 at 12:32 AM, Jonas Galvez wrote: > >> Just installed Python2.7 on my OSX Leopard with make altinstall. >> >> No missing dependencies, but I have one annoying problem: the delete

Re: Qt not working o Wing ide 3.2

2010-09-26 Thread Detlev Offenbach
Thomas Jollans wrote: > On Sunday 26 September 2010, it occurred to tayfuryılmaz to exclaim: >> hi everyone ı develop a program with pythoon and qt on wing ide >> ı use pyqt module in my program bu when ı debug a program,python is >> not debugging and o.s show a screen for solution.. and solution

Re: sequence multiplied by -1

2010-09-26 Thread John Nagle
On 9/26/2010 1:16 AM, Paul Rubin wrote: Steven D'Aprano writes: There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", Why would it not be ["spam","spam","spam"] or even "ssspppaaammm"? Should "spam"*2.5 be "spamspamsp"? Should "spam"-"a" be "spm"? What about "spamspam"-"a"?

Re: adding a method to an existing builtin class

2010-09-26 Thread Chris Rebert
On Sun, Sep 26, 2010 at 9:07 AM, TP wrote: > Hi everybody, > > Today I have learned a bit of the news of Python 3.0 compared to 2.4 > version. > > By the way, I have asked myself if it is possible to add a method to a > builtin type The built-in types' classes are immutable; you can only add/over

adding a method to an existing builtin class

2010-09-26 Thread TP
Hi everybody, Today I have learned a bit of the news of Python 3.0 compared to 2.4 version. By the way, I have asked myself if it is possible to add a method to a builtin type as 'unicode': >>> a="foo" >>> type(a) >>> print(dir(a)) ['__add__', ..., 'zfill'] For example, I would like to add a

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Ben Morrow
Quoth p...@informatimago.com (Pascal J. Bourguignon): > > It's too complex. Just write: > > (let ((list '((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2 k l) (4 m n) > (2 o p) (4 q r) (5 s t Unless you're going to talk about Perl, please take clpmisc out of the xpost. Ben -- h

Re: sequence multiplied by -1

2010-09-26 Thread Mel
Grant Edwards wrote: > On 2010-09-26, Paul Rubin wrote: >> Steven D'Aprano writes: >>> There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", > >> Why would it not be ["spam","spam","spam"] or even "ssspppaaammm"? > > Because > > 3 * "spam" == "spam" + "spam" + "spam" > > Ju

Re: sequence multiplied by -1

2010-09-26 Thread Grant Edwards
On 2010-09-26, Paul Rubin wrote: > Steven D'Aprano writes: >> There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", > Why would it not be ["spam","spam","spam"] or even "ssspppaaammm"? Because 3 * "spam" == "spam" + "spam" + "spam" Just like 3 * 6 = 6 + 6 + 6 So now I su

Re: Qt not working o Wing ide 3.2

2010-09-26 Thread Thomas Jollans
On Sunday 26 September 2010, it occurred to tayfuryılmaz to exclaim: > hi everyone ı develop a program with pythoon and qt on wing ide > ı use pyqt module in my program bu when ı debug a program,python is > not debugging and o.s show a screen for solution.. and solution says > python is not debuggi

Qt not working o Wing ide 3.2

2010-09-26 Thread tayfuryılmaz
hi everyone ı develop a program with pythoon and qt on wing ide ı use pyqt module in my program bu when ı debug a program,python is not debugging and o.s show a screen for solution.. and solution says python is not debugging. can he/she explain this solve problem.. thanks regards.. -- http://mail.

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Sherm Pendley
Jürgen Exner writes: > livibetter wrote: >>Here is mine for Python: > > What the f*** does Python have to do with Perl? Xah is a cross-posting troll. Please don't feed the troll. sherm-- -- Sherm Pendley Cocoa Developer -

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Sherm Pendley
Jürgen Exner writes: > Alexander Burger wrote: >>In PicoLisp: > > What the f does PicoLisp have to with Perl? It's Xah. He cross-posts in an attempt to start a language feud. Please don't feed the troll. sherm-- -- Sherm Pendley

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Pascal J. Bourguignon
Xah Lee writes: > here's a interesting toy list processing problem. > > I have a list of lists, where each sublist is labelled by > a number. I need to collect together the contents of all sublists > sharing > the same label. So if I have the list > > ((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2

Re: creating python daemon ?

2010-09-26 Thread Brian Jones
I don't believe you need to be doing all kinds of acrobatics with apache and your python process. On Linux and Unix machines, you can tell the stock syslog daemon that messages sent to a certain syslog facility are to be sent to a named pipe. So, if you tell syslog that, say, the local6 facility sh

Re: sequence multiplied by -1

2010-09-26 Thread BartC
"Yingjie Lan" wrote in message news:mailman.1050.1285403326.29448.python-l...@python.org... Hi, I noticed that in python3k, multiplying a sequence by a negative integer is the same as multiplying it by 0, and the result is an empty sequence. It seems to me that there is a more meaningful s

Re: equivalent of bash "set -x" in Python

2010-09-26 Thread TP
James Mills wrote: > What do you mean by "command" ? For example, print statements, but it could extend to class definitions, etc. I am going to examine the solution given by Chris. Cheers, Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\ 9&1+,\'Z4(55l4('])" "When

Re: sequence multiplied by -1

2010-09-26 Thread Ian
On 26/09/2010 07:27, Steven D'Aprano wrote: I'm surprised that you think that you should be able to apply arbitrary mathematical operations to strings *before* turning them into an int and still get sensible results. That boggles my mind. You clearly have not been "spoiled rotten" by php.

Re: equivalent of bash "set -x" in Python

2010-09-26 Thread Chris Rebert
On Sun, Sep 26, 2010 at 3:17 AM, TP wrote: > Hi everybody, > > I am interested in having the possibility to print every Python commands in > a script (for didactic purpose). > So I am looking for some sort of equivalent of bash "set -x". > Does it exist? Not exactly. However, defining an appropri

Re: equivalent of bash "set -x" in Python

2010-09-26 Thread James Mills
On Sun, Sep 26, 2010 at 8:17 PM, TP wrote: > Hi everybody, > > I am interested in having the possibility to print every Python commands in > a script (for didactic purpose). > So I am looking for some sort of equivalent of bash "set -x". > Does it exist? What do you mean by "command" ? cheers Ja

equivalent of bash "set -x" in Python

2010-09-26 Thread TP
Hi everybody, I am interested in having the possibility to print every Python commands in a script (for didactic purpose). So I am looking for some sort of equivalent of bash "set -x". Does it exist? Thanks Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\ 9&1+,\'Z4(5

Re: sequence multiplied by -1

2010-09-26 Thread Paul Rubin
Seebs writes: > * It seems clear that, given two sequences x and y, "x + y" ought to > be the concatenation of these sequences. >... > Helps, perhaps, that I got exposed to group theory early enough to be used > to redefining + and * to be any two operations which have interesting > properties*.

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Dr.Ruud
On 2010-09-26 06:05, Xah Lee wrote: I have a list of lists, where each sublist is labelled by a number. I need to collect together the contents of all sublists sharing the same label. So if I have the list ((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2 k l) (4 m n) (2 o p) (4 q r) (5 s t)) where

Re: sequence multiplied by -1

2010-09-26 Thread Seebs
On 2010-09-26, Steven D'Aprano wrote: > On Sat, 25 Sep 2010 23:46:57 -0700, Paul Rubin wrote: >> I think the idea is you should not be able to do mathematical operations >> on strings, and if you try to do one, Python should raise an exception, >> rather than using hokey analogies to guess at what

Re: creating python daemon ?

2010-09-26 Thread Stefan Schwarzer
Hi Daniel, On 2010-09-23 07:30, vineet daniel wrote: > On Sep 22, 2:20 pm, de...@web.de (Diez B. Roggisch) wrote: >> vineet daniel writes: >>> On Sep 21, 9:47 pm, de...@web.de (Diez B. Roggisch) wrote: vineet daniel writes: > code that I am using is as follows : >> > #! /usr/bin/env

Re: toy list processing problem: collect similar terms

2010-09-26 Thread Arnaud Delobelle
On 26 Sep, 08:47, livibetter wrote: > Here is mine for Python: > > l = [[0, 'a', 'b'], [1, 'c', 'd'], [2, 'e', 'f'], [3, 'g', 'h'], [1, > 'i', 'j'], [2, 'k', 'l'], [4, 'm', 'n'], [2, 'o', 'p'], [4, 'q', 'r'], > [5, 's', 't']] > d = {} > for idx, items in [(e[0], e[1:]) for e in l]: d[idx] = d[idx]

Re: sequence multiplied by -1

2010-09-26 Thread Paul Rubin
Steven D'Aprano writes: > There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", Why would it not be ["spam","spam","spam"] or even "ssspppaaammm"? Should "spam"*2.5 be "spamspamsp"? Should "spam"-"a" be "spm"? What about "spamspam"-"a"? And what about "spam"/2? "sp" be an ok

Checker 1.4 Released!

2010-09-26 Thread Chris Withers
I'm pleased to announce a new release of Checker. This is a cross-platform, pluggable tool for comparing the configuration of a machine with a known configuration stored in text files in a source control system all written in Python. This release adds a 'command' checker that lets you record and

Re: sequence multiplied by -1

2010-09-26 Thread Steven D'Aprano
On Sat, 25 Sep 2010 23:46:57 -0700, Paul Rubin wrote: > Steven D'Aprano writes: >> I'm surprised that you think that you should be able to apply arbitrary >> mathematical operations to strings *before* turning them into an int >> and still get sensible results. That boggles my mind. > > I think

Re: toy list processing problem: collect similar terms

2010-09-26 Thread livibetter
Here is mine for Python: l = [[0, 'a', 'b'], [1, 'c', 'd'], [2, 'e', 'f'], [3, 'g', 'h'], [1, 'i', 'j'], [2, 'k', 'l'], [4, 'm', 'n'], [2, 'o', 'p'], [4, 'q', 'r'], [5, 's', 't']] d = {} for idx, items in [(e[0], e[1:]) for e in l]: d[idx] = d[idx] + items if idx in d else items print d.values()