Re: Executing a list of functions

2007-03-16 Thread Michel Claveau
Hi! Your code run OK for me. But, if you want "time-lag" (sorry for my english) execution, you can try this: def a(): print "this is a" def b(): print "this is b" lst = [a, b] [f() for f in lst] -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/py

Can Epydoc be used to parse eggs

2007-03-16 Thread davels
I'm trying to use epydoc (3.0beta1) to generate documentation for some packages I've installed as eggs. When I run the epydoc command "epydoc.py -v -o sqlalchemy sqlalchemy" in completes without error, but the resulting documentation is just a stub. Everything All Functions sqlalchemy.global_

Re: Python shell on mac os x

2007-03-16 Thread 7stud
On Mar 16, 2:53 am, [EMAIL PROTECTED] wrote: > or go tohttp://pythonmac.org/packages/ > and you have python 2.5 or python 2.4.4 with readline support The download instructions seem to steer Mac users to version 2.4.4 because it has more modules available. What is the consensus on that? -- http:

File extension

2007-03-16 Thread Anil Kumar
Hi, Can Python Script can have different extensions like .sh etc Or Is .py is mandatory to be present as the extension for the Python Script. We have an application where the script was initially written in shell script with extension .sh. Now we are migrating this script to be run in both U

Obtaining Webpage Source with Python

2007-03-16 Thread paul debrigida
hey bud this is ryan kaskel just wanted tuch base we have the same name little disapointed i did not come up on my google searchryan kaskel balt mdsearch parkville high school lacrosse-- http://mail.python.org/mailman/listinfo/python-list

Re: Executing a list of functions

2007-03-16 Thread James Stroud
HMS Surprise wrote: > Seems to me that one should be able to put the names of several > functions in a list and then have the list executed. But it seems the > output of the functions is hidden, only their return value is visible. > Is this because the list execution is another scope? > > Thanx, >

Re: Circular Class Logic

2007-03-16 Thread greg
Paul McGuire wrote: > I always assumed that super, being added to > the language later, represented some form of improvement, but this may > not be 100% correct. It's not -- super is not a replacement for explicit inherited method calls. It does something different, and has different use cases. I

Re: Returning other instance from __init__ - I need help

2007-03-16 Thread Paulo da Silva
Paulo da Silva escreveu: > Paulo da Silva escreveu: >> Alex Martelli escreveu: >>> Paulo da Silva <[EMAIL PROTECTED]> wrote: >> >> >>> E.g.: >>> >>> class C1(object): >>> def __new__(cls, xxx): >>> if xxx: return type.__new__(cls, xxx) >>> else: return C1.load(xxx) >>>

Re: Mastering Python

2007-03-16 Thread cga2000
On Fri, Mar 16, 2007 at 09:27:21AM EST, BartlebyScrivener wrote: > On Mar 16, 8:39 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > > > > Wow, are you still reading? Quit wasting time and go download a > > Python dist and get started already! > > > > I think you should extract that and spend twent

Re: Finding the insertion point in a list

2007-03-16 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Or with a generator comprehension > n = sum ( y>x[i] for i in range(len(x)) ) - 1 > > But there has to be a cleaner way, as the first approach is unwieldy > and does not adapt to changing list lengths, and the second is not > obvious to a casual reader of the code. H

Re: Python Eggs on Cygwin

2007-03-16 Thread [EMAIL PROTECTED]
Jason, On 3/16/07, Jason Tishler <[EMAIL PROTECTED]> wrote: > The following is a WAG... > > Does the MySQL Python module contain shared extension modules (i.e., > DLLs)? If so, are they executable? If not, then make them so (i.e., > chmod +x). I did: % unzip MySQL_foo_bar.eggs % chmod +x M

import error

2007-03-16 Thread Nick Burns
Hi,   Quick question. I am running python on windows xp. i want to import my own module "mymod". However, when I try to import it i get the error message "ImportError: no module named mymod".   "mymod" is located in a directory that is part of the computer's "path" env variable. Imports fine if 'my

Re: Mastering Python

2007-03-16 Thread Alex Martelli
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > need to catch up quickly and master Python programming.How do you > > Mastery and quickly are opposing terms Took me 15 years on a job > using FORTRAN 77 and I still wouldn't have called myself a master. (I'm > more of a JoAT) My favorite "Stars!

Weekly Python Patch/Bug Summary

2007-03-16 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 342 open (-38) / 3712 closed (+54) / 4054 total (+16) Bugs: 951 open (-14) / 6588 closed (+33) / 7539 total (+19) RFE : 257 open (-15) / 266 closed (+13) / 523 total ( -2) New / Reopened Patches __ ftp.pytho

Re: Returning other instance from __init__

2007-03-16 Thread Steven D'Aprano
On Thu, 15 Mar 2007 04:33:01 +, Paulo da Silva wrote: > I would like to implement something like this: > > class C1: > def __init__(self,xxx): > if ... : > self.foo = foo > self.bar = bar > else: >

Odd error

2007-03-16 Thread [EMAIL PROTECTED]
I'm trying to use a script that I originally wrote on a Mac Classic machine and have moved to a Windows XP machine. I can open the script and edit the thing, but when I try to run it in I get: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python25\lib\lib-tk\Tkinter.p

Re: mySQLdb versus platform problem

2007-03-16 Thread John Nagle
Robin Becker wrote: > John Nagle wrote: > >> Try: >> >> db=MySQLdb.connect(host='appx',db='sc_0',user='user',passwd='secret', >> use_unicode=True, charset = "utf8") >> >> The distinction is that "use_unicode" tells Python to convert to Unicode, >> but Python doesn't know the MySQL table ty

Re: Finding the insertion point in a list

2007-03-16 Thread Steven D'Aprano
On Fri, 16 Mar 2007 18:17:08 -0800, Paul Rubin wrote: > [EMAIL PROTECTED] writes: >> Or with a generator comprehension >> n = sum ( y>x[i] for i in range(len(x)) ) - 1 >> >> But there has to be a cleaner way, as the first approach is unwieldy >> and does not adapt to changing list lengths, and

Re: Finding the insertion point in a list

2007-03-16 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > (1) It's wrong. That always returns the length of the list. Perhaps you > meant something like this? > len(["anything will do" for t in x if y > t]) Yeah, that's what I meant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the insertion point in a list

2007-03-16 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > or even > > len(filter(lambda t, y=y: y>t, x)) How about min(i for i,t in enumerate(x) if t >= y) or max(i for i,t in enumerate(x) if t <= y) Those are actually pretty direct. -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2007-03-16 Thread Milton Segura
Hello, I'm trying to exclude files from a list using the following code: for item in dirs:if item.find('Software') > -1:dirs.remove(item) elif item.find('Images') > -1:dirs.remove(item) let's supose dirs = ['C:\Images', 'C:\Images\2006', 'C:\Images\2007', 'C:\Music', 'C

Generating HTML containing XML in an INPUT tag

2007-03-16 Thread bendorge
Hi there, Using Python, I'm auto-generating an HTML file that contains: , where XXX is XML data (encoded somehow). Articles regarding unicode are making my head spin! Is there a way to encode XML file contents to a hexadecimal string that could be decoded on a PHP server? I have an XML file that

Re: Mastering Python

2007-03-16 Thread John Nagle
Alex Martelli wrote: > Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > >>>need to catch up quickly and master Python programming.How do you >> >>Mastery and quickly are opposing terms Took me 15 years on a job >>using FORTRAN 77 and I still wouldn't have called myself a master. (I'm >>more of a

Re: Mastering Python

2007-03-16 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > Execution model: dynamic stack-type interpreter. Erm, the iterator protocol makes the above a little more complicated. > Biggest headache is finding out what doesn't work in the libraries. Good observation. -- http://mail.python.org/mailman/lis

Re: Weekly Python Patch/Bug Summary

2007-03-16 Thread Dick Moores
May I ask a dumb question here? It isn't clear to me what to do with these patches. For most of them there is something like, "Committed as r54386 and r54387". I'm familiar with updating the editor Ulipad to the latest revision, using software such as TortoiseSVN and RapidSVN. Is that what is mea

<    1   2