Re: sql escaping module

2005-12-07 Thread Fredrik Lundh
Fredrik Lundh wrote: >> web searchs for 'python sql escape string' yeild way too many results. >> >> Any pointers would be greatly appreciated. > > for x in range(100): >print "USE PARAMETERS TO PASS VALUES TO THE DATABASE" for an example, see "listing 2" in the following article: h

Re: efficient 'tail' implementation

2005-12-07 Thread bonono
Mike Meyer wrote: > It would probably be more efficient to read blocks backwards and paste > them together, but I'm not going to get into that. > That actually is a pretty good idea. just reverse the buffer and do a split, the last line becomes the first line and so on. The logic then would be no

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: >> Except "trick" is a poor word choice. Nobody is playing a trick on >> them - they just don't understand what is going on. > oops, never thought about the negative meaning of it, it is just meant > as "not behave as expected", what would be the word you use then ? Surp

Re: efficient 'tail' implementation

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading everything

Re: efficient 'tail' implementation

2005-12-07 Thread bonono
[EMAIL PROTECTED] wrote: > hi > > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading eve

efficient 'tail' implementation

2005-12-07 Thread s99999999s2003
hi I have a file which is very large eg over 200Mb , and i am going to use python to code a "tail" command to get the last few lines of the file. What is a good algorithm for this type of task in python for very big files? Initially, i thought of reading everything into an array from the file and

Re: movie module

2005-12-07 Thread davidtweet
Hello, It would be helpful to know what platform you are on, because it appears that the movie module of pygame is not implemented for Windows currently: http://www.pygame.org/docs/ref/movie.html The page recommends PyMedia as an alternative: http://www.pymedia.org Finally, you might get a

Re: sql escaping module

2005-12-07 Thread Fredrik Lundh
David Bear wrote: > Being new to pgdb, I'm finding there are lot of things I don't understand > when I read the PEP and the sparse documentation on pgdb. > > I was hoping there would be a module that would properly escape longer text > strings to prevent sql injection -- and other things just make

Re: Documentation suggestions

2005-12-07 Thread Bengt Richter
On Thu, 8 Dec 2005 01:32:08 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: > >> > wasn't the idea to get rid of the language reference altogether, and >> > replace it with a better introduction ? >> >> Can an introduction provide the information the language >> referen

Re: Another newbie question

2005-12-07 Thread [EMAIL PROTECTED]
Mike, Thanks for your insight. It has been a big help. I guess I was trying to learn too much with my original code. Trying to implement inheritance, object creation, calling methods via inheritance made the code harder than it needed to be. I'm off to study the code. (Hmm.. how does python pars

first post: new to pythong. some questions.

2005-12-07 Thread shawn a
Hello. Im brand new to this list and to python.  Ive recently started reading about it  and am now in the tinkering stage.  I have a script im working on that i need some asistance debugging. Its super small and should be a snap for you gurus =) I have 2 files in a dir off my home dir: mkoneurl.py

Re: Mutability of function arguments?

2005-12-07 Thread bonono
Mike Meyer wrote: > Except "trick" is a poor word choice. Nobody is playing a trick on > them - they just don't understand what is going on. > oops, never thought about the negative meaning of it, it is just meant as "not behave as expected", what would be the word you use then ? -- http://mail.

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer wrote: >> [EMAIL PROTECTED] writes: >> > Mike Meyer wrote: >> >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: >> >> > I'm trying to create a function that can take arguments, say, foo and >> >> > bar, and modify the original copies of foo and bar as well as its l

Re: Another newbie question

2005-12-07 Thread Mike Meyer
"solaris_1234" <[EMAIL PROTECTED]> writes: > 1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems > awkward. Is there another way (cleaner, more intuitive) to get the > same thing done? Yes. Reaching through objects to do things is usually a bad idea. Some languages don't allow you

python24.dll and encodings ?

2005-12-07 Thread Bugs
I believe I read in a relatively recent thread that the reason python24.dll is so large compared to previous releases is that all the language encodings are linked into the library? Are there any plans for future releases to split the encodings out so that, for example, if someone wanted to mak

sql escaping module

2005-12-07 Thread David Bear
Being new to pgdb, I'm finding there are lot of things I don't understand when I read the PEP and the sparse documentation on pgdb. I was hoping there would be a module that would properly escape longer text strings to prevent sql injection -- and other things just make sure the python string obje

Re: Calculating Elapsed Time

2005-12-07 Thread Grant Edwards
On 2005-12-08, Bengt Richter <[EMAIL PROTECTED]> wrote: >>We're seeing floating point representation issues. >> >>The resolution of the underlying call is exactly 1us. Calling >>gettimeofday() in a loop in C results in deltas of exactly 1 or >>2 us. Python uses a C double to represent time, an

Re: Mutability of function arguments?

2005-12-07 Thread bonono
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > > Mike Meyer wrote: > >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: > >> > I'm trying to create a function that can take arguments, say, foo and > >> > bar, and modify the original copies of foo and bar as well as its local > >> > versions -- the equi

Re: Implementing deepcopy

2005-12-07 Thread Mr.Rech
Thanks for your answer. Since perfomances are not an issue in my case I think I'd stay with copy.copy(). In this way I'm not required to know in advance the object type, and I can implement a __deepcopy__ method for my own classes as follows: >>> def __deepcopy__(self, memo = {}): new

Re: Is Python string immutable?

2005-12-07 Thread Frank Potter
Thank you very much.Steve Holden, I post my soucecode at my blog here:http://hiparrot.wordpress.com/2005/12/08/implementing-a-simple-net-spider/ I wish you can read and give me some suggestion. Any comments will be appreciated.On 12/2/05, Steve Holden < [EMAIL PROTECTED]> wrote:could ildg wrote:> I

[ANN] Python-OpenID 1.0

2005-12-07 Thread Kevin Turner
It is with great pleasure that JanRain, Inc. announces version 1.0 of the Python OpenID library. This library contains packages to support both OpenID consumers (relying parties) and servers. For back-end storage, it supports a variety of methods, including flat file, SQL, and MemCached. In our

Re: Mutability of function arguments?

2005-12-07 Thread Carl J. Van Arsdall
> > And, indeed, would that approach work? Would declaring: > > class FooWrapper : > __init__(fooToLoad) : > self.foo = fooToLoad > > mean that I could now declare a FooWrapper holding a foo, pass the > FooWrapper to a function, and have the function conclude with the foo > within the

Re: Mutability of function arguments?

2005-12-07 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > > Many people from C/C++ background would be tricked for this situation. > > That's because they don't understand binding. Any language that has > bindings instead of has assignments will "trick" them this way. ...Java being probably the most popular examp

Re: Implementing deepcopy

2005-12-07 Thread Alex Martelli
Mr.Rech <[EMAIL PROTECTED]> wrote: ... > Suppose one of the attributes of my class is a dictionary whose values > are callable functions, such as: > > >>>def foo(): > .pass > >>>def bar(): > .pass > > >>>adict = dict(a = foo, b = bar) > > Now if I try: > > >>> anotherdict = c

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer wrote: >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: >> > I'm trying to create a function that can take arguments, say, foo and >> > bar, and modify the original copies of foo and bar as well as its local >> > versions -- the equivalent of C++ funct(&foo, &bar)

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > seems to be asking a lot for some people.) And at some > companies, one has to jump though beauracratic hoops > for each external package installed. And I personally > stear away from packages that have a long list of > prerequisites. Funny -- me, I prefer to

Re: Mutability of function arguments?

2005-12-07 Thread Brett g Porter
ex_ottoyuhr wrote: > I'm trying to create a function that can take arguments, say, foo and > bar, and modify the original copies of foo and bar as well as its local > versions -- the equivalent of C++ funct(&foo, &bar). > > I've looked around on this newsgroup and elsewhere, and I gather that > th

Another newbie question

2005-12-07 Thread solaris_1234
I am a python newbie and have been trying to learn python. To this end, I have coded the following program creates: a 8 by 8 checker board Places two checkers on the board Checks the board and prints out which squares has a checker on them. It works. But I have a one question: 1) The stmt "board

Re: Mutability of function arguments?

2005-12-07 Thread Fredrik Lundh
"ex_ottoyuhr" wrote: > I've looked around on this newsgroup and elsewhere, and I gather that > this is a very common concern in Python, but one which is ordinarily > answered with "No, you can't. Neat, huh?" A few websites, newsgroup > posts, etc. have recommended that one ask for a more "Pythonic

Re: Documentation suggestions

2005-12-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > wasn't the idea to get rid of the language reference altogether, and > > replace it with a better introduction ? > > Can an introduction provide the information the language > reference provides (or maybe I am misunderstanding what > you mean by introduction.) from th

Re: uuDecode problem

2005-12-07 Thread Alex Martelli
py <[EMAIL PROTECTED]> wrote: ... > """data is a string""" > if len(data) > 45: > tmp = [] > for c in data: > tmp.append(binascii.b2a_uu(c)) You can't decode b2a-encoded data character by character, blindly, as you're trying to to here. Each character in the

Re: Mutability of function arguments?

2005-12-07 Thread bonono
Mike Meyer wrote: > "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: > > I'm trying to create a function that can take arguments, say, foo and > > bar, and modify the original copies of foo and bar as well as its local > > versions -- the equivalent of C++ funct(&foo, &bar). > > C++'s '&' causes an argum

Re: Mutability of function arguments?

2005-12-07 Thread Mark Tolonen
"ex_ottoyuhr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to create a function that can take arguments, say, foo and > bar, and modify the original copies of foo and bar as well as its local > versions -- the equivalent of C++ funct(&foo, &bar). > > I've looked around

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
"ex_ottoyuhr" <[EMAIL PROTECTED]> writes: > I'm trying to create a function that can take arguments, say, foo and > bar, and modify the original copies of foo and bar as well as its local > versions -- the equivalent of C++ funct(&foo, &bar). C++'s '&' causes an argument to be passed by reference.

Re: Bitching about the documentation...

2005-12-07 Thread Dan Sommers
On Thu, 08 Dec 2005 12:19:13 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Linguists call that "garden path sentences", because they lead the > reader/listener up the garden path. > Here are some more examples: [ examples snipped ] And the ever-popular, ever-ambiguous: Women can fish. R

Re: Calculating Elapsed Time

2005-12-07 Thread Bengt Richter
On Wed, 07 Dec 2005 18:32:50 -, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2005-12-07, Fredrik Lundh <[EMAIL PROTECTED]> wrote: ... >> if I keep running the script over and over again, I do get individual >> >> -1.19209289551e-06 >> >> items from time to time on both machines... > >We're see

Re: Documentation suggestions

2005-12-07 Thread Steven Bethard
Aahz wrote: > In article <[EMAIL PROTECTED]>, > A.M. Kuchling <[EMAIL PROTECTED]> wrote: > >>So now we're *really* stuck. The RefGuide doesn't describe the rules; >>the PEP no longer describes them either; and probably only Guido can >>write the new text for the RefGuide. (Or are the semantics t

Re: Memoizing decorator

2005-12-07 Thread Daishi Harada
Hi, Sorry about the previous dup; I'm posting through Google Groups which seems to have burped. Anyways, I've "improved" things (or at least got things passing more tests). I now bind the cache to each object instance (and class for classmethods). At least one issue still remains, mostly due to

hi i have some doubts on a volume and the file system

2005-12-07 Thread muttu2244
hi everybody, i want to check the position of a volume in a particular drive. say for example in a disk i have 3 different drives: C:\ , D:\ and E:\. Now if i want to check what position is the D:\ in, how can i write the code. Means whether its in a 0th position or 1st position or a 2nd position

Re: Bitching about the documentation...

2005-12-07 Thread Steven D'Aprano
On Wed, 07 Dec 2005 17:15:03 -0500, Mike Meyer wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: >>> Er... no, I can't parse that. I suffered a Too Much Recursion error about >>> the third Badger (I only have a limited runtime stack). > > I always loved the demonstration that English requires

Re: Mutability of function arguments?

2005-12-07 Thread ex_ottoyuhr
(Re. mutability question:) Update, never mind. I found that the FooWrapper solution isn't so bad after all -- and even better is putting the variable in question in a different module entirely. However, anyone who wants to answer the question is still welcome to. Sorry to be a bother, and to have

Re: Documentation suggestions

2005-12-07 Thread rurpy
Fredrik Lundh wrote: > Ian Bicking wrote: > > > > the standard library is not an add-on. you're confused. > > > > I think the point is that there is the core language, and from a user's > > perspective builtins and statements and syntax are all the same thing. > > When you import a module, it's m

Re: How to ping in Python?

2005-12-07 Thread [EMAIL PROTECTED]
There is also always searching the Python Cookbook (http://pythoncookbook.activestate.com/) for something like this. There is already an ICMP library there (written by me and a friend) that includes a ping function that uses the library. -Brett -- http://mail.python.org/mailman/listinfo/python-l

Mutability of function arguments?

2005-12-07 Thread ex_ottoyuhr
I'm trying to create a function that can take arguments, say, foo and bar, and modify the original copies of foo and bar as well as its local versions -- the equivalent of C++ funct(&foo, &bar). I've looked around on this newsgroup and elsewhere, and I gather that this is a very common concern in

Re: unittest and non-.py files

2005-12-07 Thread Sybren Stuvel
Michael Hoffman enlightened us with: > Hi. I am trying to use unittest to run a test suite on some > scripts that do not have a .py extension. I'd move the functionality of the script into a separate file that does end in .py, and only put the invocation into the .py-less script. Sybren -- The p

Re: Python web publishing framework like Cocoon?

2005-12-07 Thread James
None of those are anything like Cocoon. I can't think of any other Python equivalents. -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation suggestions

2005-12-07 Thread rurpy
[EMAIL PROTECTED] wrote: > Ian> I think the point is that there is the core language, and from a > Ian> user's perspective builtins and statements and syntax are all the > Ian> same thing. When you import a module, it's more-or-less obvious > Ian> where you find information about the

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-07 Thread Sybren Stuvel
Steven D'Aprano enlightened us with: > Once the lookup table is created, you shouldn't use that function > again -- at best it is just sitting around like a third wheel, at > worst it might have side-effects you don't want. So I del the > function. I'd prefer to check the lookup table, and raise a

Re: how to put form and display its result(data from database) on the same window?

2005-12-07 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I have designed a web application. In its one window I put a form. User > can click submit button of this form to run a pathon script to get data > from database. Then User get a new window which display the result. Now > I want to put the form and display data on the sam

Re: Documentation suggestions

2005-12-07 Thread skip
Ian> I think the point is that there is the core language, and from a Ian> user's perspective builtins and statements and syntax are all the Ian> same thing. When you import a module, it's more-or-less obvious Ian> where you find information about the module (the module index, of

Re: Documentation suggestions

2005-12-07 Thread Fredrik Lundh
Ian Bicking wrote: > > the standard library is not an add-on. you're confused. > > I think the point is that there is the core language, and from a user's > perspective builtins and statements and syntax are all the same thing. > When you import a module, it's more-or-less obvious where you find

Re: Documentation suggestions

2005-12-07 Thread skip
>> http://staging.musi-cal.com/modindex/ rurpy> Is this only for the online docs? Yes. I don't see that it would be helpful for static docs. Presumably they will get reorganized. I want something for the many times I return to the global module index looking for help with a particul

Re: Documentation suggestions

2005-12-07 Thread Ian Bicking
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > The builtins section should be moved to the language > > reference manual. The material it documents is part > > of the language definition, not part of an add-on library. > > the standard library is not an add-on. you're confused. I think th

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > as I've said many times, if the Linux folks can build distributions that con- > sists of thousands of individually maintained pieces, the Python distributors > should be able to handle a few dozen components. Yes, but "distributers" is not necessarily

Re: Documentation suggestions

2005-12-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: > > [EMAIL PROTECTED] wrote: > > > > > The builtins section should be moved to the language > > > reference manual. The material it documents is part > > > of the language definition, not part of an add-on library. > > > > the standard library is no

Re: ElementTree - Why not part of the core?

2005-12-07 Thread rurpy
Steven Bethard wrote: --snip-- > I think some people were hoping that instead of adding these things to > the standard library, we would come up with a better package manager > that would make adding these things to your local library much simpler. > > STeVe > > [1]http://www.python.org/dev/summar

Re: Python web publishing framework like Cocoon?

2005-12-07 Thread Dan M
> Is there a Python web publishing framework like Cocoon? > > I found Maki but it was last updated in > 2003 and its author says that he doesn't want to make another release... How about: http://www.cherrypy.org/ http://www.turbogears.org/ http://www.djangoproject.

Re: Documentation suggestions

2005-12-07 Thread rurpy
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > The builtins section should be moved to the language > > reference manual. The material it documents is part > > of the language definition, not part of an add-on library. > > the standard library is not an add-on. you're confused. > > Your

Python web publishing framework like Cocoon?

2005-12-07 Thread Dennis Benzinger
Hi! Is there a Python web publishing framework like Cocoon? I found Maki but it was last updated in 2003 and its author says that he doesn't want to make another release... Bye, Dennis -- http://mail.python.org/mailman/listinfo/python-list

unittest and non-.py files

2005-12-07 Thread Michael Hoffman
Hi. I am trying to use unittest to run a test suite on some scripts that do not have a .py extension. This is how I am doing it now in test/test_polysub.py which is meant to test scripts/polysub: """ import imp from path import path as Path SCRIPTNAME = "polysub" test_dirpath = Path(__file__).par

Re: Documentation suggestions

2005-12-07 Thread rurpy
[EMAIL PROTECTED] wrote: > >> The library reference has so many modules that the table of contents > >> is very large. Again, not really a problem that we can fix; > >> splitting it up into separate manuals doesn't seem like it would > >> help. > > Iain> I like the Global Module I

Re: Documentation suggestions

2005-12-07 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The builtins section should be moved to the language > reference manual. The material it documents is part > of the language definition, not part of an add-on library. the standard library is not an add-on. you're confused. -- http://mail.python.org/mailman/list

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Simon Percivall
Before that can happen we'll need some better management of co-existing different versions of a package. You'll want to be able to use newer versions of external packages without breakage in the standard library. -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation suggestions

2005-12-07 Thread rurpy
Adam Olsen wrote: > On 12/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Adam> I don't expect everything to make the transition. Are discussions > > Adam> of "atoms" and fragments of BNF really better than calling them > > Adam> expressions and linking to CPython's Grammar

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread Fredrik Lundh
"spike grobstein" write: > I understand why it wasn't working and it makes sense based on the > structure of namespaces that python defines, however, I'm just > surprised that there isn't some kind of built-in facility for dealing > with these types of things. > > Module packages are a spectacular

Re: how to put form and display its result(data from database) on the same window?

2005-12-07 Thread Xavier Morel
[EMAIL PROTECTED] wrote: > Hi Guys, > > I have designed a web application. In its one window I put a form. User > can click submit button of this form to run a pathon script to get data > from database. Then User get a new window which display the result. Now > I want to put the form and display d

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
I understand why it wasn't working and it makes sense based on the structure of namespaces that python defines, however, I'm just surprised that there isn't some kind of built-in facility for dealing with these types of things. Module packages are a spectacular idea, it is just kinda easy to get c

Re: Documentation suggestions

2005-12-07 Thread rurpy
"Michael Spencer" <[EMAIL PROTECTED]> wrote: > A.M. Kuchling wrote: > > On Tue, 06 Dec 2005 10:29:33 -0800, > > Michael Spencer <[EMAIL PROTECTED]> wrote: > >> not that helpful. "Miscellaneous Services", in particular, gives no clue > >> to > >> treasures it contains. I would prefer, for exampl

Re: Bitching about the documentation...

2005-12-07 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: >> Er... no, I can't parse that. I suffered a Too Much Recursion error about >> the third Badger (I only have a limited runtime stack). I always loved the demonstration that English requires backtracking: "The old man the ship." h

Re: option argument length

2005-12-07 Thread Peter Otten
Ritesh Raj Sarraf wrote: > ./sarraf.py --fetch-update /bar > > If the user gives the /bar argument, the program should save the > downloaded files to /bar. But I'm assuming that the user could be dumb or > too lazy, in which case --fetch-udpate should use the parser.set_defaults > value i.e. /foo

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Fredrik Lundh
Steven Bethard wrote: > > ElementTree on the other hand provides incredibly easy access to XML > > elements and works in a more Pythonic way. Why has the API not been > > included in the Python core? > > While I fully agree that ElementTree is far more Pythonic than the > dom-based stuff in the c

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread Heiko Wundram
spike grobstein wrote: > so, since python supports module packages like it does, you'd think > that it would have ways of making add-on or extension modules to be > more self contained. Errm... You're not quite understanding what the problem is about. A class is just an object. A class object may

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
oh, wow. that works!!! thanks for the help! so, since python supports module packages like it does, you'd think that it would have ways of making add-on or extension modules to be more self contained. Thanks, again! -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation suggestions

2005-12-07 Thread Aahz
In article <[EMAIL PROTECTED]>, A.M. Kuchling <[EMAIL PROTECTED]> wrote: > >So now we're *really* stuck. The RefGuide doesn't describe the rules; >the PEP no longer describes them either; and probably only Guido can >write the new text for the RefGuide. (Or are the semantics the same >and only so

how to put form and display its result(data from database) on the same window?

2005-12-07 Thread lli
Hi Guys, I have designed a web application. In its one window I put a form. User can click submit button of this form to run a pathon script to get data from database. Then User get a new window which display the result. Now I want to put the form and display data on the same window. How I can do

Re: Bitching about the documentation...

2005-12-07 Thread Michael Spencer
Fredrik Lundh wrote: > Rocco Moretti wrote: > >> Insert punctuation & capitalization to make the following a correct and >> coherent (if not a little tourtured). >> >> fred where guido had had had had had had had had had had had a better >> effect on the reader > > punctuation, including quote ma

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-07 Thread Cameron Laird
QOTW: "... and to my utter surprise it worked." - Andrew Nagel on his move from wxPython to programming Tkinter in desperation "Python has more web application frameworks than keywords." - Skip Montanaro (but probably others going back years) Frithiof Andreas Jensen writes frankly on use o

Re: List index question

2005-12-07 Thread mrmakent
What you mean to do is y.index('2'), rather than y.index['2']. Call the index method of the list, rather than try to use index as if it was itself a list. -- http://mail.python.org/mailman/listinfo/python-list

Re: Memoizing decorator

2005-12-07 Thread Daishi Harada
Hi Bengt, Thanks for your reply. >First, I would suggest thinking about the exact semantics of method >memoization. E.g. suppose you write > > class Oops(object): >def __init__(self, factor): self.factor = factor >@memoize_fn >def mul(self, x): >return self.f

Re: List index question

2005-12-07 Thread mrmakent
What you mean to do is y.index('2'), rather than y.index['2']. Call the index method of the list, rather than try to use index as if it was itself a list. -- http://mail.python.org/mailman/listinfo/python-list

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread Heiko Wundram
spike grobstein wrote: > I'd like the packages to define a file path for supporting files > (graphics, etc) that are stored inside the package. The problem is that > the superclass's definition (stored elsewhere) has all of the code for > actually opening the files, so when I use the > os.path.dirn

Re: Documentation suggestions

2005-12-07 Thread Michael Spencer
A.M. Kuchling wrote: > On Tue, 06 Dec 2005 10:29:33 -0800, > Michael Spencer <[EMAIL PROTECTED]> wrote: >> not that helpful. "Miscellaneous Services", in particular, gives no clue to >> treasures it contains. I would prefer, for example, to see the data >> structure modules: collections,

ANN: Python training, 2006 Feb 1-3, San Francisco

2005-12-07 Thread w chun
What: Python Programming I: Introduction to Python When: February 1-3, 2006 Where: San Francisco, CA, USA Web:http://cyberwebconsulting.com Need to get up-to-speed with Python as quickly as possible? Come join us in beautiful Northern California for another rigorous Python training event

Re: List index question

2005-12-07 Thread Fredrik Lundh
"questions?" wrote: >I want to do list index function. y=['1','2','3','4'] y > ['1', '2', '3', '4'] y.index['2'] make that: >>> y.index('2') -- http://mail.python.org/mailman/listinfo/python-list

Re: List index question

2005-12-07 Thread questions?
sorry, I realized the problem already. sorry for the confusion. THanks for the answer!!! -- http://mail.python.org/mailman/listinfo/python-list

Re: List index question

2005-12-07 Thread Heiko Wundram
questions? wrote: > I want to do list index function. y=['1','2','3','4'] y > ['1', '2', '3', '4'] y.index['2'] > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsubscriptable object > > It works with y=[1,2,3,4]. Anyone has any hint, what's the reason >

List index question

2005-12-07 Thread questions?
I want to do list index function. >>> y=['1','2','3','4'] >>> y ['1', '2', '3', '4'] >>> y.index['2'] Traceback (most recent call last): File "", line 1, in ? TypeError: unsubscriptable object It works with y=[1,2,3,4]. Anyone has any hint, what's the reason here? thanks -- http://mail.pytho

Re: Memoizing decorator

2005-12-07 Thread Daishi Harada
Hi Bengt, Thanks for your reply. >First, I would suggest thinking about the exact semantics of method >memoization. E.g. suppose you write > > class Oops(object): >def __init__(self, factor): self.factor = factor >@memoize_fn >def mul(self, x): >return self.f

os.execvp()'ing an ssh command on windows

2005-12-07 Thread Kevin Smith
I have a tool that invokes a command on a remote machine using ssh (cygwin) on Windows. Typing the command at a command prompt works fine. I get prompted to verify the host and asked for a password. If I try the same command under python using an os.execvp(), things get screwy. I get prompt

opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
So, I've got this project I'm working on where the app defines various classes that are subclassed by module packages that act like plugins... I'd like the packages to define a file path for supporting files (graphics, etc) that are stored inside the package. The problem is that the superclass's d

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Jarek Zgoda
Steven Bethard napisał(a): >> ElementTree on the other hand provides incredibly easy access to XML >> elements and works in a more Pythonic way. Why has the API not been >> included in the Python core? > > While I fully agree that ElementTree is far more Pythonic than the > dom-based stuff in th

Re: Documentation suggestions

2005-12-07 Thread A.M. Kuchling
On Wed, 7 Dec 2005 07:45:13 -0600, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Just because that audience is small doesn't mean they are unimportant. > There are currently four actively maintained/developed implementations of > Python. A common language reference manual is important fo

Re: Bitching about the documentation...

2005-12-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Rocco Moretti <[EMAIL PROTECTED]> wrote: > >Reminds me of this old classic: > >Insert punctuation & capitalization to make the following a correct and >coherent (if not a little tourtured). > >fred where guido had had had had had had had had had had had a better >

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-07 Thread David Rasmussen
Antoon Pardon wrote: >> >>Write shorter functions ;) > > This has little to do with long functions. A class can contain > a large number of methods, whitch are all rather short, and your > class will still be spread over several pages. > Write classes with a smaller interface ;-) /David -- htt

Re: ANN: pygene - genetic algorithms package

2005-12-07 Thread Erik Max Francis
Peter Hansen wrote: > You're certainly correct there. The leap to GP is much farther than my > stuff is from GA. I'm curious what sort of heterogeneous data setup you had. > I agree, and I look forward to seeing Psi some time, if just to help me > learn more in the area. Thanks again for the

Re: Bitching about the documentation...

2005-12-07 Thread Fredrik Lundh
Rocco Moretti wrote: > Insert punctuation & capitalization to make the following a correct and > coherent (if not a little tourtured). > > fred where guido had had had had had had had had had had had a better > effect on the reader punctuation, including quote marks, I presume? it's not time to

Re: option argument length

2005-12-07 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Peter, Peter Otten on Wednesday December 7 2005 21:25 wrote: > This can be simplified to > > parser.add_option("-d", "--download-dir", default="foo", > help="Root directory path to save the downloaded files") > > which seems to be the reaso

Re: Binary representation of floating point numbers

2005-12-07 Thread 63q2o4i02
That looks pretty cool. I'll try it out. thanks Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation suggestions

2005-12-07 Thread Mark Jackson
Steven Bethard <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > Iain> I like the Global Module Index in general - it allows quick access > > Iain> to exactly what I want. I would like a minor change to it though > > Iain> - stop words starting with a given letter rolling over

Re: Bitching about the documentation...

2005-12-07 Thread Rocco Moretti
>>>One of my favourite examples of obfuscated English is this grammatically >>>correct sentence: >>> >>>"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo." > > The punctuation is important. Reminds me of this old classic: Insert punctuation & capitalization to make the following

  1   2   3   >