Re: Python3: API Documentation generator

2010-09-27 Thread Chris Rebert
On Sun, Sep 26, 2010 at 11:56 PM, Tim Diels wrote: >  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 > document

Re: Calling an arbitrary function with the right arguments

2010-09-27 Thread Bruno Desthuilliers
John O'Hagan a écrit : How to call a function with the right arguments without knowing in advance which function? (snip) For most use case I can think of, I can only second Steven and Chris - if your functions are interchangeable then they should have a same API. Now there's at least one u

Re: Calling an arbitrary function with the right arguments

2010-09-27 Thread Peter Otten
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=random.choice((1,2,3)) >

Re: Calling an arbitrary function with the right arguments

2010-09-27 Thread Jean-Michel Pichavant
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=random.choice((1,2,3)) myfunc=random.choice((f1, f2,

check path.exists() with a "converted" path

2010-09-27 Thread Alessandro
Hi, I'm a python newbie with a problem too hard to tackle. I have a string defining a path, were all the spaces have been converted to underscores. How can I find if it corresponds to a real path? e.g. a string like '/some/path_to/directory_1/and_to/directory_2' with a real path: '/some/path_to/d

Re: check path.exists() with a "converted" path

2010-09-27 Thread Chris Rebert
On Mon, Sep 27, 2010 at 2:23 AM, Alessandro wrote: > Hi, I'm a python newbie with a problem too hard to tackle. > > I have a string defining a path, were all the spaces have been > converted to underscores. > How can I find if it corresponds to a real path? > > e.g. a string like '/some/path_to/di

problem in Gasp !

2010-09-27 Thread n.a.s
Hi, I want to ask about graphics using Gasp .Attached is exercise 10 (houses at night) ,if i call the draw_house function once it will work properly ,but more than one call,windows and doors disappear from some houses . Any one can advic

Re: check path.exists() with a "converted" path

2010-09-27 Thread Paul Rudin
Alessandro writes: > Hi, I'm a python newbie with a problem too hard to tackle. > > I have a string defining a path, were all the spaces have been > converted to underscores. > How can I find if it corresponds to a real path? > > e.g. a string like '/some/path_to/directory_1/and_to/directory_2' >

Re: check path.exists() with a "converted" path

2010-09-27 Thread Raphaël Plasson
On Sep 27, 6:23 pm, Alessandro wrote: > > I have a string defining a path, were all the spaces have been > converted to underscores. > (...) > > notice that the real path can contain BOTH spaces and underscores. > > How can I feed it to os.path.exists() ??? You are losing some information, ther

Re: check path.exists() with a "converted" path

2010-09-27 Thread Peter Otten
Alessandro wrote: > Hi, I'm a python newbie with a problem too hard to tackle. > > I have a string defining a path, were all the spaces have been > converted to underscores. > How can I find if it corresponds to a real path? > > e.g. a string like '/some/path_to/directory_1/and_to/directory_2' >

Re: check path.exists() with a "converted" path

2010-09-27 Thread Alessandro
people, you're great - best newsgroup I've ever been! I think I'll go with the glob suggestion - works like a charm!!! thank you... alessandro -- http://mail.python.org/mailman/listinfo/python-list

Re: Too much code - slicing

2010-09-27 Thread Antoon Pardon
On Thu, Sep 23, 2010 at 12:23:22AM +, Steven D'Aprano wrote: > On Tue, 21 Sep 2010 16:17:48 +0200, Antoon Pardon wrote: > > > On Tue, Sep 21, 2010 at 12:07:07AM +, Steven D'Aprano wrote: > >> On Mon, 20 Sep 2010 19:28:49 +0200, Antoon Pardon wrote: > >> > >> > Not necessarily. Some of us

Plone Conference 2010 schedule published

2010-09-27 Thread Matt Hamilton
Over 400 attendees are set to meet at the 8th annual Plone Conference for a week-long programme of training, talks and developer sprints from the 25th to 31st October at the Thistle Grand Hotel in Bristol, UK. Plone Conference 2010 registrations are open. Plone, an Open Source Content Management

possible circular import problem with python-3, but not python-2

2010-09-27 Thread Darren Dale
I am attempting to contribute to the h5py project by porting the code for python-3. The code is available in a branch at github: http://github.com/darrendale/h5py/tree/py3k . That code uses cython to wrap the hdf5 library. So far, only a few minor changes have been needed (relative imports, change

Re: Errors with PyPdf

2010-09-27 Thread flebber
On Sep 27, 2:46 pm, Dave Angel wrote: > 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 getPD

Re: Raw Sockets - IP-Encapsulation

2010-09-27 Thread Alexander Gattin
Hello, On Fri, Sep 24, 2010 at 04:51:01PM +0100, Nobody wrote: > On Thu, 23 Sep 2010 21:41:19 +0200, Matthias > Guentert wrote: > > I would like to create an IP tunnel using the > > IP protocol type 4 (socket.IPPROTO_IPIP) on a > > Linux host. (I also would be happy if I could > > create a GRE tun

minimal D: need software testers

2010-09-27 Thread Kruptein
Hey, I've released the second alpha for minimal-D a program I've written in python which should make developing easier. I need people to test the app on bugs and give ideas. It is written in python using the wxPython toolkit and is linux-only. (using on windows is on own risk) You can download a

reduced-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Mirko
On Sep 26, 12:05 am, Xah Lee wrote: I am hijacking the following post and driving it to Cuba (the Monthy Python fans will know what I refer to). I want to create a `reduce'- like function that can handle similar problems. Xah said: > here's a interesting toy list processing problem. > > I have

Re: reduce-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Mirko
On Sep 27, 11:18 am, Mirko wrote: > On Sep 26, 12:05 am, Xah Lee wrote: > > I am hijacking the following post and driving it to Cuba (the Monthy > Python fans will know what I refer to).  I want to create a `reduce'- > like function that can handle similar problems. > > Xah said: > > > > > here's

Introducing Kids to Programming: 2 or 3?

2010-09-27 Thread Marco Gallotta
Hi there I'm sure you get a lot of "2 or 3" questions, but here's another. Umonya [1] uses Python to introduce school kids to programming. The initiative is only 15 months old and up till now we've been using existing notes and exercises and thus Python 2. But we're at the stage where we can eithe

Re: reduce-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Mirko
On Sep 27, 11:40 am, Mirko wrote: > On Sep 27, 11:18 am, Mirko wrote: > > > > > On Sep 26, 12:05 am, Xah Lee wrote: > > > I am hijacking the following post and driving it to Cuba (the Monthy > > Python fans will know what I refer to).  I want to create a `reduce'- > > like function that can hand

Re: Introducing Kids to Programming: 2 or 3?

2010-09-27 Thread Andreas Waldenburger
On Mon, 27 Sep 2010 17:48:06 +0200 Marco Gallotta wrote: > Since these are kids, we feel the nice changes in 3 such as removing > integer division will help in teaching. It will also remove confusion > when they go to download Python and grab the latest version. Since > they're just starting, cha

Konya - Turkish Company Directory - NEW ! - Seyfi Suna www.een.kso.org.tr

2010-09-27 Thread Seyfi Suna
Konya - Turkish Company Directory - NEW ! - Seyfi Suna www.een.kso.org.tr http://www.een.kso.org.tr/en/konya-firma-rehberi/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3: API Documentation generator

2010-09-27 Thread Tim Diels
On 27/09/2010 09:02, Chris Rebert wrote: On Sun, Sep 26, 2010 at 11:56 PM, Tim Diels wrote: 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 proje

Re: "Strong typing vs. strong testing"

2010-09-27 Thread namekuseijin
On 27 set, 05:46, TheFlyingDutchman wrote: > On Sep 27, 12:58 am, p...@informatimago.com (Pascal J. Bourguignon) > wrote: > > RG writes: > > > In article > > > <7df0eb06-9be1-4c9c-8057-e9fdb7f0b...@q16g2000prf.googlegroups.com>, > > >  TheFlyingDutchman wrote: > > > >> On Sep 22, 10:26 pm, "Scot

relative imports and sub-module execution

2010-09-27 Thread King
Hi, After reading couple of docs and articles, I have implemented a simple test package with nested modules. When running "main.py", everything is working fine. Some of my sub- modules has some small test routines for debug purpose. It's because I am using relative package imports at the top, I am

Re: Introducing Kids to Programming: 2 or 3?

2010-09-27 Thread Terry Reedy
On 9/27/2010 11:48 AM, Marco Gallotta wrote: Hi there I'm sure you get a lot of "2 or 3" questions, but here's another. Umonya [1] uses Python to introduce school kids to programming. The initiative is only 15 months old and up till now we've been using existing notes and exercises and thus Pyth

Re: Python3: API Documentation generator

2010-09-27 Thread Terry Reedy
On 9/27/2010 1:15 PM, Tim Diels wrote: On 27/09/2010 09:02, Chris Rebert wrote: On Sun, Sep 26, 2010 at 11:56 PM, Tim Diels wrote: 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 docst

Re: Python3: API Documentation generator

2010-09-27 Thread Ken Watford
On Mon, Sep 27, 2010 at 1:15 PM, Tim Diels wrote: > On 27/09/2010 09:02, Chris Rebert wrote: >> >> On Sun, Sep 26, 2010 at 11:56 PM, Tim Diels  wrote: >>> >>>  Hi all >>> >>> I've just switched to python3 and it turns out my current API >>> documentation >>> generator (epydoc) no longer works. I a

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-27 Thread Xah Lee
2010-09-27 > For instance, this is far more convenient: > [x+1 for x in [1,2,3,4,5] if x%2==0] > than this: > map(lambda x:x+1,filter(lambda x:x%2==0,[1,2,3,4,5])) How about this: LC(func, inputList, P) compared to [func for myVar in inputList if P] the functional form is: • shorter • n

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-27 Thread namekuseijin
On 27 set, 16:06, Xah Lee wrote: > 2010-09-27 > > > For instance, this is far more convenient: > > [x+1 for x in [1,2,3,4,5] if x%2==0] > > than this: > > map(lambda x:x+1,filter(lambda x:x%2==0,[1,2,3,4,5])) > > How about this: [snip] how about this: read before replying. -- http://mail.python

Re: Introducing Kids to Programming: Scratch

2010-09-27 Thread Kee Nethery
My son has been writing games using MIT's Scratch. It is visual and highly interactive. In an afternoon he can build something that looks cool to him, is interactive, and that he can share with others. It's not Python but he is learning how to make the tools do what he wants and he is getting re

Re: "Strong typing vs. strong testing"

2010-09-27 Thread Pascal J. Bourguignon
namekuseijin writes: >> in C I can have a function maximum(int a, int b) that will always >> work. Never blow up, and never give an invalid answer. If someone >> tries to call it incorrectly it is a compile error. >> In a dynamic typed language maximum(a, b) can be called with incorrect >> dataty

Re: "Strong typing vs. strong testing"

2010-09-27 Thread Scott L. Burson
Pascal J. Bourguignon wrote: On the other hand, with the dynamic typing mindset, you might even wrap your values (of whatever numerical type) in a symbolic expression mentionning the unit and perhaps other meta data, so that when the other module receives it, it may notice (dynamically) that two

Re: "Strong typing vs. strong testing"

2010-09-27 Thread Pascal J. Bourguignon
"Scott L. Burson" writes: > Pascal J. Bourguignon wrote: >> >> On the other hand, with the dynamic typing mindset, you might even wrap >> your values (of whatever numerical type) in a symbolic expression >> mentionning the unit and perhaps other meta data, so that when the other >> module receive

Re: toy list processing problem: collect similar terms

2010-09-27 Thread ccc31807
On Sep 26, 12:05 am, 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) (

Re: [ctpug] Introducing Kids to Programming: 2 or 3?

2010-09-27 Thread Simon Cross
On Mon, Sep 27, 2010 at 5:48 PM, Marco Gallotta wrote: > We received a grant from Google to reach 1,000 kids in South Africa > with our course in 2011. People have also shown interest in running > the course in Croatia, Poland and Egypt. We're also eyeing developing > African countries in the long

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-27 Thread Xah Lee
On Sep 27, 12:11 pm, namekuseijin wrote: > On 27 set, 16:06, Xah Lee wrote:> 2010-09-27 > > > > For instance, this is far more convenient: > > > [x+1 for x in [1,2,3,4,5] if x%2==0] > > > than this: > > > map(lambda x:x+1,filter(lambda x:x%2==0,[1,2,3,4,5])) > > > How about this: > > [snip] > > h

Re: program organization question for web development with python

2010-09-27 Thread Hans
On Sep 17, 2:36 am, Bruno Desthuilliers wrote: > Hans a écrit : > (snip) > > > Maybe I did not make my question clear. I never tried python web > > programing before, so I want to start from CGI. > > You can indeed learn quite a few things doing raw CGI - the most > important one being why framewo

Nautilus Python

2010-09-27 Thread Eduardo Ribeiro
I'm a python noob and wrote the following code for a nautilus extension: #!/usr/local/bin/python # -*- coding: utf-8 -*- import urllib import gtk import pygtk import nautilus import gconf import gtk.glade class Slide (nautilus.MenuProvider): f = None def __init__(self): self

vhttp://www.vipshops.org/ nike air jordan shoe for sale,nike , chanal, gucci, juicy, polo tshirt.adidas and so on.all are free shipping.

2010-09-27 Thread fcgffj
nike air jordan shoes http://www.vipshops.org/ nike shoes http://www.vipshops.org/ ed hardy http://www.vipshops.org/ SUIT ShortJ ERSEY Jean Jacket Hoody http://www.vipshops.org/ T-ShirtT http://www.vipshops.org/ -Shirt_W http://www.vipshops.org/ Tracksuit_W http://www.vipshops.org/ Skirt_W http://

strange results from sys.version

2010-09-27 Thread John Machin
I am trying to help a user of my xlrd package who says he is getting anomalous results on his "work computer" but not on his "home computer". Attempts to reproduce his alleged problem in a verifiable manner on his "work computer" have failed, so far ... the only meaning difference in script ou

Re: strange results from sys.version

2010-09-27 Thread Robert Kern
On 9/27/10 6:01 PM, John Machin wrote: I am trying to help a user of my xlrd package who says he is getting anomalous results on his "work computer" but not on his "home computer". Attempts to reproduce his alleged problem in a verifiable manner on his "work computer" have failed, so far ... the

Re: strange results from sys.version

2010-09-27 Thread Sridhar Ratnakumar
On 2010-09-27, at 4:30 PM, Robert Kern wrote: > On 9/27/10 6:01 PM, John Machin wrote: >> I am trying to help a user of my xlrd package who says he is getting >> anomalous >> results on his "work computer" but not on his "home computer". >> >> Attempts to reproduce his alleged problem in a veri

Re: strange results from sys.version

2010-09-27 Thread Sridhar Ratnakumar
On 2010-09-27, at 4:01 PM, John Machin wrote: > User (work): sys.version: 2.7 (r27:82500, Aug 23 2010, 17:18:21) etc > Me : sys.version: 2.7 (r27:82525, Jul 4 2010, 09:01:59) etc > > [...] User result looks whacked: lower patch number, later date Perusing http://svn.python.org/view/pyt

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-27 Thread namekuseijin
On 27 set, 18:39, Xah Lee wrote: > On Sep 27, 12:11 pm, namekuseijin wrote: > > > On 27 set, 16:06, Xah Lee wrote:> 2010-09-27 > > > > > For instance, this is far more convenient: > > > > [x+1 for x in [1,2,3,4,5] if x%2==0] > > > > than this: > > > > map(lambda x:x+1,filter(lambda x:x%2==0,[1,2

Re: Debugger - fails to "continue" with breakpoint set

2010-09-27 Thread Danny Levinson
Does this describe the problem you are having? http://bugs.python.org/issue5294 -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems reading tif files

2010-09-27 Thread gujax
On Sep 26, 9:19 pm, Christian Heimes wrote: > 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 fe

Re: Problems reading tif files

2010-09-27 Thread gujax
Thanks Christian, Here is the info: TIFF Directory at offset 0x8 (8) Subfile Type: (0 = 0x0) Image Width: 640 Image Length: 480 Bits/Sample: 32 Sample Format: IEEE floating point Compression Scheme: None Photometric Interpretation: min-is-black Samples/Pixel: 1 Rows/Strip: 480 Pla

Re: "Strong typing vs. strong testing"

2010-09-27 Thread John Nagle
On 9/27/2010 10:46 AM, namekuseijin wrote: On 27 set, 05:46, TheFlyingDutchman wrote: On Sep 27, 12:58 am, p...@informatimago.com (Pascal J. Bourguignon) wrote: RG writes: In article <7df0eb06-9be1-4c9c-8057-e9fdb7f0b...@q16g2000prf.googlegroups.com>, TheFlyingDutchman wrote: On Sep 22

Re: Nautilus Python

2010-09-27 Thread Steven D'Aprano
On Mon, 27 Sep 2010 15:28:34 -0700, Eduardo Ribeiro wrote: > But it doesn't work. What do you mean "doesn't work"? - It crashes the operating system; - You get a core dump; - You get an exception; - It hangs forever, never doing anything; - It does something unexpected; - Something else? -- S

Re: reduced-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Steven D'Aprano
On Mon, 27 Sep 2010 08:18:22 -0700, Mirko wrote: > Here is my Common Lisp (and I only care about Common Lisp answers) Good for you. So why are you spamming other newsgroups with your CL solution? Not once, but three times. Replies to /dev/null. -- Steven -- http://mail.python.org/mailman/lis

Re: toy list processing problem: collect similar terms

2010-09-27 Thread Seebs
On 2010-09-26, Xah Lee wrote: > 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. > btw, i disagree about your remark on crossposting. You're wrong. Crosspost

Re: toy list processing problem: collect similar terms

2010-09-27 Thread Seebs
On 2010-09-26, J?rgen Exner wrote: > It was livibetter who without any motivation or reasoning posted Python > code in CLPM. Not exactly; he posted it in a crossposted thread, which happened to include CLPM and other groups, including comp.lang.python. It is quite possible that he didn't know ab

How to Deal with Xah Lee Spam/Abuse (was: toy list processing problem: collect similar terms)

2010-09-27 Thread John Bokma
Seebs writes: > On 2010-09-26, Xah Lee wrote: >> 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. > >> btw, i disagree about your remark on crossposting. >

Re: toy list processing problem: collect similar terms

2010-09-27 Thread John Bokma
Seebs writes: > On 2010-09-26, J?rgen Exner wrote: >> It was livibetter who without any motivation or reasoning posted Python >> code in CLPM. > > Not exactly; he posted it in a crossposted thread, which happened to include > CLPM and other groups, including comp.lang.python. > > It is quite pos

Example of exec_proxy

2010-09-27 Thread Prathibha G
Hi Team, I am very new to this python world. Below is my problem. I have a "Machine A" where i want to execute some commands(dos commands from command prompt), delete/create some files, delete/create some directories. All this i need to do from my local host. Is there a way which i can do? Can

Re: Nautilus Python

2010-09-27 Thread Peter
On Sep 28, 12:31 pm, Steven D'Aprano wrote: > On Mon, 27 Sep 2010 15:28:34 -0700, Eduardo Ribeiro wrote: > > But it doesn't work. > > What do you mean "doesn't work"? > > - It crashes the operating system; > - You get a core dump; > - You get an exception; > - It hangs forever, never doing anythin

Re: toy list processing problem: collect similar terms

2010-09-27 Thread Seebs
On 2010-09-28, John Bokma wrote: > Seebs writes: >> On 2010-09-26, J?rgen Exner wrote: >>> It was livibetter who without any motivation or reasoning posted Python >>> code in CLPM. >> Not exactly; he posted it in a crossposted thread, which happened to include >> CLPM and other groups, includin

Re: toy list processing problem: collect similar terms

2010-09-27 Thread John Bokma
Seebs writes: fup set to poster > On 2010-09-28, John Bokma wrote: >> Seebs writes: >>> On 2010-09-26, J?rgen Exner wrote: It was livibetter who without any motivation or reasoning posted Python code in CLPM. > >>> Not exactly; he posted it in a crossposted thread, which happened to

tix problem in ubuntu karmic

2010-09-27 Thread harryos
hi I posted this question in ubuntu users forum but no help was forthcoming.. I hope someone can help me here. I had been using jaunty as o.s and was coding in python 2.6. While using Tix widgets in my code I came across a bug as mentioned in https://bugs.launchpad.net/ubuntu/+source/tix/+bug/3

Re: Nautilus Python

2010-09-27 Thread Wayne Brehaut
On Mon, 27 Sep 2010 20:57:09 -0700 (PDT), Peter wrote: >On Sep 28, 12:31 pm, Steven D'Aprano t...@cybersource.com.au> wrote: >> On Mon, 27 Sep 2010 15:28:34 -0700, Eduardo Ribeiro wrote: >> > But it doesn't work. >> >> What do you mean "doesn't work"? >> >> - It crashes the operating system; >> -