Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-03 Thread Ron Adam
Steven D'Aprano wrote: On Sat, 02 Jul 2005 20:26:31 -0700, Devan L wrote: Claiming that sum etc. do the same job is the whimper of someone who doesn't want to openly disagree with Guido. Could you give an example where sum cannot do the job(besides the previously mentioned product

Re: Will Guido's Python Regrets ever get implemented/fixed?

2005-07-03 Thread [EMAIL PROTECTED]
Thanks! Even the fact that these ideas have been organized into a PEP is exciting to methere is hope that they may *someday* be implemented. Maybe sooner than people think. Another reason to love Python like no other. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with this code?

2005-07-03 Thread Nathan Pinno
Hi all, Sure I'm able to publish the code, only the previous version though. If you want the first version; find Josh Cogliati, and ask him. It didn't have a random function, though. I got the idea to improve it from my computer course. Here is the code: #Plays the guessing game

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-03 Thread Erik Max Francis
Ron Adam wrote: But together, sum and product, probably cover about 90% of situations in which you would use reduce. Getting a total (sum) from a list probably covers 80% of the situations reduce would be used on it's own. (I can't think of any real uses of product at the moment. It's

How to get 4 numbers from the user in one line for easy comparision?

2005-07-03 Thread Nathan Pinno
I saw that great idea from Steven, and I appreciate it. I think it will work. Just need to figure out how to get 4 numbers from the player on one line for easy comparison, e.g. telling whether the number is correct position and number, incorrect position and correct number, or both are

a question

2005-07-03 Thread Xinyue Ye
when I type sys.ps2 after import sys, I got the message like: Traceback (most recent call last): File pyshell#10, line 1, in -toplevel- sys.ps2 AttributeError: 'module' object has no attribute 'ps2' why does it happen? -- http://mail.python.org/mailman/listinfo/python-list

debugger?

2005-07-03 Thread Qiangning Hong
I have read a lot of posts discussing python IDEs, but most of them focus on the editor, GUI builder, project management, customizability, etc Some talked about debugging capability, but only on an available/unavailable level. I use vim to edit my code, wxGlade to build the GUI or hand-code

Re: debugger?

2005-07-03 Thread Detlev Offenbach
Qiangning Hong wrote: I have read a lot of posts discussing python IDEs, but most of them focus on the editor, GUI builder, project management, customizability, etc Some talked about debugging capability, but only on an available/unavailable level. I use vim to edit my code, wxGlade

Re: Favorite non-python language trick?

2005-07-03 Thread Steven D'Aprano
On Sun, 03 Jul 2005 00:39:19 -0400, Christopher Subich wrote: Devan L wrote: sum(sequence[0] + [1/element for element in sequence[1:]]) I think that should work. That won't work, because it misses the x*y part of the expression (x[n]*x[n+1] + 1/x[n+1], for people who haven't immediately

how to retrive highlighted text in a browser?

2005-07-03 Thread wcc
Hello group, When browsing websites, quite often I have to look up words in dictionary. I'm hoping that I can come up with a python program that does the following: When I highlight some text in browser and right-click, besides the default options such as COPY, PASTE, etc, I want an option that

Re: a question

2005-07-03 Thread Steven D'Aprano
On Sun, 03 Jul 2005 03:19:45 -0400, Xinyue Ye wrote: when I type sys.ps2 after import sys, I got the message like: Traceback (most recent call last): File pyshell#10, line 1, in -toplevel- sys.ps2 AttributeError: 'module' object has no attribute 'ps2' why does it happen? It works for

Re: Favorite non-python language trick?

2005-07-03 Thread Peter Otten
Steven D'Aprano wrote: How do you replace: reduce(lambda x,y: x*y-1/y, sequence) with sum? missing = object() def my_reduce(f, items, first=missing): class adder: def __init__(self, value): self.value = value def __add__(self, other): return

question about raw_input

2005-07-03 Thread wcc
Hello group, After searching free IDE for a while, i picked PyScripter(http://mmm-experts.com/Products.aspx). It is neat. I like it. But I always get error when using raw_input function. Please see below. raw_input(Press ENTER to continue...) Press ENTER to continue...Traceback (most recent

website catcher

2005-07-03 Thread jwaixs
Hello, I'm busy to build some kind of webpage framework written in Python. But there's a small problem in this framework. This framework should open a page, parse it, take some other information out of it and should store it in some kind of fast storage. This storage need to be very fast so every

Re: debugger?

2005-07-03 Thread Qiangning Hong
Detlev Offenbach wrote: Qiangning Hong wrote: I have read a lot of posts discussing python IDEs, but most of them focus on the editor, GUI builder, project management, customizability, etc Some talked about debugging capability, but only on an available/unavailable level. I use vim to

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-03 Thread egbert
On Sat, Jul 02, 2005 at 08:26:31PM -0700, Devan L wrote: Also, map is easily replaced. map(f1, sequence) == [f1(element) for element in sequence] How do you replace map(f1,sequence1, sequence2) especially if the sequences are of unequal length ? I didn't see it mentioned yet as a candidate

question

2005-07-03 Thread yipusi
IDLE 1.0.3 import sys sys.ps2 Traceback (most recent call last): File pyshell#1, line 1, in -toplevel- sys.ps2 AttributeError: 'module' object has no attribute 'ps2' where is the problem? -- Forwarded message -- From: Steven D'Aprano [EMAIL PROTECTED] To:

Re: a question

2005-07-03 Thread tiissa
Xinyue Ye wrote: when I type sys.ps2 after import sys, I got the message like: Traceback (most recent call last): File pyshell#10, line 1, in -toplevel- sys.ps2 AttributeError: 'module' object has no attribute 'ps2' why does it happen? sys.ps2 is defined in an interactive session only

Re: how to retrive highlighted text in a browser?

2005-07-03 Thread Jordan Rastrick
I don't know how hard this would be to do in Python - appending text to a file is straightforward, but it sounds like you'd need to extend the browser itself to get the functionality you want. The most obvious choice if you want an extensible browser is Mozilla Firefox

Tkinter Checkbutton initialization problem

2005-07-03 Thread Paul Rubin
Python 2.4, Windows XP. If I say: f = Frame() f.grid() v = IntVar() c = Checkbutton(f, text='hi there', variable=v) c.grid() f.mainloop() then the checkbutton should initially display as being checked. But it doesn't. It shows up unchecked, even though v.get() returns

what is the difference between command prompt and IDLE?

2005-07-03 Thread shisa
what is the difference between command prompt and IDLE? -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-03 Thread Andrea Griffini
On Sat, 2 Jul 2005 03:04:09 -0700 (PDT), Ralf W. Grosse-Kunstleve [EMAIL PROTECTED] wrote: Hi fellow Python coders, I often find myself writing:: class grouping: def __init__(self, x, y, z): self.x = x self.y = y self.z = z # real

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tom Anderson
On Sun, 3 Jul 2005, Steven D'Aprano wrote: On Sun, 03 Jul 2005 02:22:23 +0200, Fredrik Johansson wrote: On 7/3/05, Tom Anderson [EMAIL PROTECTED] wrote: That's one way. I'd do: root = value ** 0.5 Does that mean we can expect Guido to drop math.sqrt in py3k? :) I'd rather like to see a

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Carl Banks
John Roth wrote: Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] map and filter are being removed *because of* list comprehensions. Did you even read Guido's articles about this issue? Your understanding of why these changes are planned is incorrect; consequently

No sys.ps2 in IDLE (was Re: question)

2005-07-03 Thread Michael Hoffman
yipusi wrote: IDLE 1.0.3 import sys sys.ps2 Traceback (most recent call last): File pyshell#1, line 1, in -toplevel- sys.ps2 AttributeError: 'module' object has no attribute 'ps2' where is the problem? The problem is that you are using IDLE (and an old version at

Re: No sys.ps2 in IDLE (was Re: question)

2005-07-03 Thread shisa
What should I do to correct the errors accordingly? On 7/3/05, Michael Hoffman [EMAIL PROTECTED] wrote: yipusi wrote: IDLE 1.0.3 import sys sys.ps2 Traceback (most recent call last): File pyshell#1, line 1, in -toplevel- sys.ps2 AttributeError: 'module' object has no

Re: debugger?

2005-07-03 Thread Detlev Offenbach
Qiangning Hong wrote: Detlev Offenbach wrote: Qiangning Hong wrote: I have read a lot of posts discussing python IDEs, but most of them focus on the editor, GUI builder, project management, customizability, etc Some talked about debugging capability, but only on an

Re: what is the difference between command prompt and IDLE?

2005-07-03 Thread [EMAIL PROTECTED]
start reading here: http://www.python.org/idle/doc/idlemain.html, although it is not up to date most of the information still holds up -- http://mail.python.org/mailman/listinfo/python-list

Re: question

2005-07-03 Thread [EMAIL PROTECTED]
see the answer on your previous post ( http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/8e132d9c734907b/87fd1f579a362e71?q=rnum=2hl=en#87fd1f579a362e71), to get an interactive session open a command window and type ' python' --

Re: website catcher

2005-07-03 Thread [EMAIL PROTECTED]
You can catch the content of an url like this: http://www.python.org/doc/current/lib/node478.html, from here you can parse it, and the store the result e.g. in dictionary, you will have a very well performing solution like this. -- http://mail.python.org/mailman/listinfo/python-list

Re: website catcher

2005-07-03 Thread jwaixs
Thank you, but it's not what I mean. I don't want some kind of client parser thing. But I mean the page is already been parsed and ready to be read. But I want to store this page for more use. I need some kind of database that won't exit if the cgi-bin script has finished. This database need to be

Re: website catcher

2005-07-03 Thread Diez B. Roggisch
jwaixs wrote: Thank you, but it's not what I mean. I don't want some kind of client parser thing. But I mean the page is already been parsed and ready to be read. But I want to store this page for more use. I need some kind of database that won't exit if the cgi-bin script has finished. This

Re: Python, mysql, floating point values question

2005-07-03 Thread beliavsky
Dennis Lee Bieber wrote: Considering how often this has come up, I've sort of lost faith in CS programs at colleges. Now, this might be an unfair statement as I don't know if any of those bringing up the question ever had college CS courses... But the fluff of floating point data was

Re: website catcher

2005-07-03 Thread jwaixs
If I should put the parsedwebsites in, for example, a tablehash it will be at least 5 times faster than just putting it in a file that needs to be stored on a slow harddrive. Memory is a lot faster than harddisk space. And if there would be a lot of people asking for a page all of them have to

Re: Python, mysql, floating point values question

2005-07-03 Thread Andy Dustman
Use DECIMAL columns with MySQLdb-1.2.0 and Python-2.4 and you should get values back using Python's new decimal type. http://docs.python.org/whatsnew/node9.html This avoids floating point inaccuracies. -- http://mail.python.org/mailman/listinfo/python-list

Re: Will Guido's Python Regrets ever get implemented/fixed?

2005-07-03 Thread John Roth
Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Guido gave a nice Python Regrets Power Point talk at OSCON few years ago. I was wondering if the plan is to ever implement these ideas. e.g. Guido said he'd prefer 'print' to be a *function* with

Re: debugger?

2005-07-03 Thread Frank LaFond
You might also look at Boa. http://boa-constructor.sourceforge.net/ While I haven't tried all the things on your list, I've been able to do all the things I've wanted to do in the debugger. It is also an IDE for wxPython, so it works well for that, but I don't know about other GUI libraries.

Re: website catcher

2005-07-03 Thread Diez B. Roggisch
jwaixs wrote: If I should put the parsedwebsites in, for example, a tablehash it will be at least 5 times faster than just putting it in a file that needs to be stored on a slow harddrive. Memory is a lot faster than harddisk space. And if there would be a lot of people asking for a page all

Re: Will Guido's Python Regrets ever get implemented/fixed?

2005-07-03 Thread George Sakkis
[EMAIL PROTECTED] wrote: Thanks! Even the fact that these ideas have been organized into a PEP is exciting to methere is hope that they may *someday* be implemented. Maybe sooner than people think. Given that the latest 2.x python will be 2.9 and that 3.0 may be released in parallel

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Steven D'Aprano
On Sun, 03 Jul 2005 10:56:42 +0100, Tom Anderson wrote: On Sun, 3 Jul 2005, Steven D'Aprano wrote: On Sun, 03 Jul 2005 02:22:23 +0200, Fredrik Johansson wrote: On 7/3/05, Tom Anderson [EMAIL PROTECTED] wrote: That's one way. I'd do: root = value ** 0.5 Does that mean we can expect

Re: No sys.ps2 in IDLE (was Re: question)

2005-07-03 Thread Michael Hoffman
shisa wrote: What should I do to correct the errors accordingly? What error? IDLE appears to be behaving as designed. Also, please don't top-post--it makes responding to your message in a way that others can understand more difficult. http://en.wikipedia.org/wiki/Top-posting -- Michael

How to dump an interpreter image?

2005-07-03 Thread VansMll
Hi, is it possible to save a state of the python interpreter to disk and load it later? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] How to get 4 numbers from the user in one line for easycomparision?

2005-07-03 Thread Alan G
I Just need to figure out how to get 4 numbers from the player on one line for easy comparison, Unless there is a set of batteries somewhere that I don't know about I think you have to rely on reading the line as a string and then splitting it. line = raw_input('Type 4 numbers

Re: question about raw_input

2005-07-03 Thread Michael Hoffman
wcc wrote: Hello group, After searching free IDE for a while, i picked PyScripter(http://mmm-experts.com/Products.aspx). It is neat. I like it. But I always get error when using raw_input function. Please see below. raw_input(Press ENTER to continue...) Press ENTER to

Re: How to dump an interpreter image?

2005-07-03 Thread Diez B. Roggisch
VansMll wrote: Hi, is it possible to save a state of the python interpreter to disk and load it later? Should be doable in stackless python. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tom Anderson
On Mon, 4 Jul 2005, Steven D'Aprano wrote: On Sun, 03 Jul 2005 10:56:42 +0100, Tom Anderson wrote: On Sun, 3 Jul 2005, Steven D'Aprano wrote: On Sun, 03 Jul 2005 02:22:23 +0200, Fredrik Johansson wrote: On 7/3/05, Tom Anderson [EMAIL PROTECTED] wrote: That's one way. I'd do: root =

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread George Sakkis
Steven D'Aprano [EMAIL PROTECTED] wrote: Unfortunately, floating point maths is a bit of a black art. Try this simple calculation: py 4.0/3 - 5.0/6 0.49989 Should be 0.5 exactly. Many numbers which you can write exactly in decimal cannot be stored exactly in floating point.

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread George Sakkis
Tom Anderson [EMAIL PROTECTED] wrote: And finally, does Guido know something about arithmetic that i don't, or is this expression: -1.0 ** 0.5 Evaluated wrongly? No, it is evaluated according to the rules of precedence. It is equivalent to -(1.0**0.5). You are confusing it with

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Scott David Daniels
egbert wrote: On Sat, Jul 02, 2005 at 08:26:31PM -0700, Devan L wrote: Also, map is easily replaced. map(f1, sequence) == [f1(element) for element in sequence] How do you replace map(f1,sequence1, sequence2) especially if the sequences are of unequal length ? I didn't see it mentioned

Re: How to get 4 numbers from the user in one line for easycomparision?

2005-07-03 Thread George Sakkis
Alan G [EMAIL PROTECTED] wrote: I Just need to figure out how to get 4 numbers from the player on one line for easy comparison, Unless there is a set of batteries somewhere that I don't know about I think you have to rely on reading the line as a string and then splitting it. line

Re: Tkinter Checkbutton initialization problem

2005-07-03 Thread Scott David Daniels
Paul Rubin wrote: Python 2.4, Windows XP. If I say: f = Frame() f.grid() v = IntVar() v.set(1) # Might help. v.get() at this point returned 0 for me. c = Checkbutton(f, text='hi there', variable=v) c.grid() f.mainloop() --

Re: website catcher

2005-07-03 Thread jwaixs
Well, thank you for your advice. So I have a couple of solutions, but it can't become a server at its own so this means I will deal with files. Thank you for your advice, I'll first make it work... than the server. Noud Aldenhoven -- http://mail.python.org/mailman/listinfo/python-list

How do you program in Python?

2005-07-03 Thread anthonyberet
My question isn't as all-encompassing as the subject would suggest... I am almost a Python newbie, but I have discovered that I don't get along with IDLE, as i can't work out how to run and rerun a routine without undue messing about. What I would really like is something like an old-style

Re: website catcher

2005-07-03 Thread gene tani
maybe look at Harvestman http://cheeseshop.python.org/HarvestMan/1.4%20final -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to None

2005-07-03 Thread Rocco Moretti
François Pinard wrote: [Rocco Moretti] foo, bar, _ = gen_tuple(stuff) as '_' is already special cased (last result in interactive mode), and is already used for don't care sematics in Prolog. `_' is also the `gettext' function in internationalised programs. It so seems that `_' is

A Policy for Inclusion in the Standard Library: was Modules for inclusion in standard library?

2005-07-03 Thread Colin J. Williams
Terry Reedy wrote: Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Isn't this where the discussion should start? There should be some general policy guiding the types of modules which should be in the standard library. A couple of times, Guido has given his

Re: How do you program in Python?

2005-07-03 Thread Diez B. Roggisch
anthonyberet wrote: My question isn't as all-encompassing as the subject would suggest... I am almost a Python newbie, but I have discovered that I don't get along with IDLE, as i can't work out how to run and rerun a routine without undue messing about. What I would really like is

How execute a .py in this way?

2005-07-03 Thread Peter Cai
If it's a executable file, a .exe file, you can launch it in this way, xxx.exe input.txt. The text file input.txt will be considered as the standard input. But when I use this trick on python, it doesn't work. The only way to do so is like this python xxx.py input.txt. But this method has a

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tim Peters
[Fredrik Johansson] I'd rather like to see a well implemented math.nthroot. 64**(1/3.0) gives 3.9996, and this error could be avoided. [Steven D'Aprano] math.exp(math.log(64)/3.0) 4.0 Success!!! [Tom Anderson] Eeenteresting. I have no idea why this works. Given that

Re: debugger?

2005-07-03 Thread Renato Ramonda
Qiangning Hong ha scritto: Eric3 need pyqt so it is not free under windows platform. Eric3 has had a free version for months now on windows, since the kde on win32 project recompiled the free versions on windows. And qt4 now has a GPL version free on windows too. -- Renato

Re: Tkinter Checkbutton initialization problem

2005-07-03 Thread Paul Rubin
Scott David Daniels [EMAIL PROTECTED] writes: Paul Rubin wrote: Python 2.4, Windows XP. If I say: f = Frame() f.grid() v = IntVar() v.set(1) # Might help. v.get() at this point returned 0 for me. Yeah, I tried that too. Further reorganization of the code in some

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Steven D'Aprano
On Sun, 03 Jul 2005 15:46:35 +0100, Tom Anderson wrote: I think there would be a lot less confusion over the alleged inaccuracy of floating point if everyone wrote in hex - indeed, i believe that C99 has hex floating-point literals. C has always been such a forward-thinking language! No,

Re: Favorite non-python language trick?

2005-07-03 Thread Christopher Subich
Steven D'Aprano wrote: On Sun, 03 Jul 2005 00:39:19 -0400, Christopher Subich wrote: Personally, I think demanding that it be writable as a sum (or product, or any, or all) is a false standard -- nobody's claimed that these would replace all cases of reduce, just the most common ones. Er,

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tim Peters
[Steven D'Aprano] ... But this works: py inf = float(inf) py inf inf Another platform-dependent accident. That does not work, for example, on Windows. In fact, the Microsoft C float-string routines don't support any way to spell infinity that works in the string-float direction. --

Re: how to retrive highlighted text in a browser?

2005-07-03 Thread Colin J. Williams
wcc wrote: Hello group, When browsing websites, quite often I have to look up words in dictionary. I'm hoping that I can come up with a python program that does the following: When I highlight some text in browser and right-click, besides the default options such as COPY, PASTE, etc, I

Re: How do you program in Python?

2005-07-03 Thread Peter Hansen
anthonyberet wrote: What I would really like is something like an old-style BASIC interpreter, in which I could list, modify and test-run sections of code, to see the effects of tweaks, without having to save it each time, or re-typing it over and over (I haven't even worked out how to cut

Re: How execute a .py in this way?

2005-07-03 Thread Peter Hansen
Peter Cai wrote: Thus, you can execute you py program anywhere by using the command xxx.py, but when you want to use an exsiting file as it's input, you have to use something like pythong xxx.py input.txt. This is apparently a bug or limitation of Windows command prompts and may not be

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Steven D'Aprano
On Sun, 03 Jul 2005 08:14:28 -0700, Scott David Daniels wrote: egbert wrote: On Sat, Jul 02, 2005 at 08:26:31PM -0700, Devan L wrote: Also, map is easily replaced. map(f1, sequence) == [f1(element) for element in sequence] How do you replace map(f1,sequence1, sequence2) especially if the

Using regular expressions in internet searches

2005-07-03 Thread mike . ceravolo
What is the best way to use regular expressions to extract information from the internet if one wants to search multiple pages? Let's say I want to search all of www.cnn.com and get a list of all the words that follow Michael. (1) Is Python the best language for this? (Plus is it time-efficient?)

C parser with spark

2005-07-03 Thread Sébastien Boisgérault
Hi, Has anybody already implemented a full ANSI C parser with John Aycock's spark module ? (spark : http://pages.cpsc.ucalgary.ca/~aycock/spark/) Cheers, SB -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Christopher Subich
Carl Banks wrote: Listcomps et al. cannot do everything map, lambda, filter, and reduce did. Listcomps are inferior for functional programming. But, you see, functional is not the point. Streamlining procedural programs is the point, and I'd say listcomps do that far better, and without

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Christopher Subich
Scott David Daniels wrote: egbert wrote: How do you replace map(f1,sequence1, sequence2) especially if the sequences are of unequal length ? I didn't see it mentioned yet as a candidate for limbo, but the same question goes for: zip(sequence1,sequence2) OK, you guys are picking on what

Re: Using regular expressions in internet searches

2005-07-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: What is the best way to use regular expressions to extract information from the internet if one wants to search multiple pages? Let's say I want to search all of www.cnn.com and get a list of all the words that follow Michael. (1) Is Python the best language for

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Peter Hansen
Steven D'Aprano wrote: Frankly, I find this entire discussion very surreal. Reduce etc *work*, right now. They have worked for years. If people don't like them, nobody is forcing them to use them. Python is being pushed into directions which are *far* harder to understand than map and reduce

Re: Inheriting from object

2005-07-03 Thread Bengt Richter
On Sat, 02 Jul 2005 12:26:49 -0700, Scott David Daniels [EMAIL PROTECTED] wrote: Bengt Richter wrote: On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels [EMAIL PROTECTED] wrote: Or, perhaps: class foo(object): def __init__(self, *args, **kwargs): super(foo,

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Jp Calderone
On Sun, 03 Jul 2005 14:43:14 -0400, Peter Hansen [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: Frankly, I find this entire discussion very surreal. Reduce etc *work*, right now. They have worked for years. If people don't like them, nobody is forcing them to use them. Python is being pushed

Re: Using regular expressions in internet searches

2005-07-03 Thread MyHaz
Python would be good for this, but if you just want a chuck an rumble solution might be. bash $wget -r --ignore-robots -l 0 -c -t 3 http://www.cnn.com/ bash $ grep -r Micheal.* ./www.cnn.com/* Or you could do a wget/python mix like import sys import re sys.os.command(wget -r --ignore-robots

Re: How do you program in Python?

2005-07-03 Thread [EMAIL PROTECTED]
anthonyberet wrote: My question isn't as all-encompassing as the subject would suggest... I am almost a Python newbie, but I have discovered that I don't get along with IDLE, as i can't work out how to run and rerun a routine without undue messing about. What I would really like is

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tom Anderson
On Sun, 3 Jul 2005, George Sakkis wrote: Tom Anderson [EMAIL PROTECTED] wrote: And finally, does Guido know something about arithmetic that i don't, or is this expression: -1.0 ** 0.5 Evaluated wrongly? No, it is evaluated according to the rules of precedence. It is equivalent to

Re: Using regular expressions in internet searches

2005-07-03 Thread Jp Calderone
On 3 Jul 2005 10:49:03 -0700, [EMAIL PROTECTED] wrote: What is the best way to use regular expressions to extract information from the internet if one wants to search multiple pages? Let's say I want to search all of www.cnn.com and get a list of all the words that follow Michael. (1) Is Python

need to get an index for an item in a list

2005-07-03 Thread nephish
hey there, i need to be able to get the index for an item in a list. the list is a list of lines read from a text file. like this: file = open(/home/somefile.text, r) lines = file.readlines() file.close() now, i want to see if a certain string is == to one of the lines and if so, i need to know

Re: Assigning to None (was Re: Question about Python)

2005-07-03 Thread Bengt Richter
On Sun, 03 Jul 2005 11:47:07 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote: [Peter Hansen] Mike Meyer wrote: Yes. I once grabbed an old program that did assignments to None. But that's always been a bad idea. What was the use

Re: Accepted Summer of Code proposals

2005-07-03 Thread Peter Decker
On 7/2/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: A.M. Kuchling wrote: For anyone who's interested: the Python wiki now contains a list of the PSF-mentored proposals that were accepted for Google's Summer of Code: http://wiki.python.org/moin/SummerOfCode Is it right that two

Re: PIL question: keeping metadata

2005-07-03 Thread Jarek Zgoda
Ilpo Nyyssönen napisał(a): Is there any way of keeping this info in PIL? I don't think so... when I investigated in the past, I think I discovered that the PIL can't write EXIF data (I might be wrong, though, or my information might be outdated). There is this:

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tom Anderson
On Sun, 3 Jul 2005, Tim Peters wrote: [Fredrik Johansson] I'd rather like to see a well implemented math.nthroot. 64**(1/3.0) gives 3.9996, and this error could be avoided. [Steven D'Aprano] math.exp(math.log(64)/3.0) 4.0 Success!!! None of this generalizes usefully --

Re: need to get an index for an item in a list

2005-07-03 Thread Peter Hansen
[EMAIL PROTECTED] wrote: i need to be able to get the index for an item in a list. any ideas? Fire up the interactive interpreter and learn to use it to help yourself. In this case, the most useful thing might be to know about the dir() builtin method, which you can use on a list like so:

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-03 Thread Ron Adam
Erik Max Francis wrote: Ron Adam wrote: I'm just estimating, but I think that is the gist of adding those two in exchange for reduce. Not that they will replace all of reduce use cases, but that sum and product cover most situations and can be implemented more efficiently than using

Re: need to get an index for an item in a list

2005-07-03 Thread Roy Smith
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: hey there, i need to be able to get the index for an item in a list. the list is a list of lines read from a text file. like this: file = open(/home/somefile.text, r) lines = file.readlines() file.close() now, i want to see if

Re: Accepted Summer of Code proposals

2005-07-03 Thread Peter Hansen
Peter Decker wrote: On 7/2/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: Is it right that two Wax proposals were accepted? Or that Wax is being promoted over Dabo Promoted? Do you know if any Dabo proposals were even made? And how good the proposals were? The money goes to those who

Re: need to get an index for an item in a list

2005-07-03 Thread Roy Smith
In article [EMAIL PROTECTED], Peter Hansen [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: i need to be able to get the index for an item in a list. any ideas? Fire up the interactive interpreter and learn to use it to help yourself. In this case, the most useful thing might be to

Re: Accepted Summer of Code proposals

2005-07-03 Thread Robert Kern
Peter Decker wrote: On 7/2/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: A.M. Kuchling wrote: For anyone who's interested: the Python wiki now contains a list of the PSF-mentored proposals that were accepted for Google's Summer of Code: http://wiki.python.org/moin/SummerOfCode Is it

Re: need to get an index for an item in a list

2005-07-03 Thread Peter Hansen
Roy Smith wrote: That being said, index() isn't isn't going to work if there are duplicate lines in the file; it'll return the index of the first one. It will still work, if you are willing to do a bit of work to help it: l = range(10) + [5] l [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5]

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-03 Thread Bengt Richter
On Sat, 02 Jul 2005 13:50:25 GMT, Andrew Koenig [EMAIL PROTECTED] wrote: Ralf W. Grosse-Kunstleve [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] class grouping: def __init__(self, .x, .y, .z): # real code right here Emulation using existing syntax::

Re: How do you program in Python?

2005-07-03 Thread James
Peter Hansen wrote: anthonyberet wrote: What I would really like is something like an old-style BASIC interpreter, in which I could list, modify and test-run sections of code, to see the effects of tweaks, without having to save it each time, or re-typing it over and over (I haven't

Re: math.nroot [was Re: A brief question.]

2005-07-03 Thread Tom Anderson
On Mon, 4 Jul 2005, Steven D'Aprano wrote: On Sun, 03 Jul 2005 15:46:35 +0100, Tom Anderson wrote: I think there would be a lot less confusion over the alleged inaccuracy of floating point if everyone wrote in hex - indeed, i believe that C99 has hex floating-point literals. C has always

Re: Determining actual elapsed (wall-clock) time

2005-07-03 Thread Bengt Richter
On Sat, 2 Jul 2005 19:44:19 -0400, Tim Peters [EMAIL PROTECTED] wrote: [Peter Hansen] Hmmm... not only that, but at least under XP the return value of time.time() _is_ UTC. At least, it's entirely unaffected by the daylight savings time change, or (apparently) by changes in time zone. On all

Re: A Policy for Inclusion in the Standard Library: was Modules forinclusion in standard library?

2005-07-03 Thread Terry Reedy
Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Terry Reedy wrote: A couple of times, Guido has given his general policy as generally useful; best-of-breed, tested and accepted by the community; and backed by a developer who will adapt it and its doc up to

Re: Accepted Summer of Code proposals

2005-07-03 Thread Peter Decker
On 7/3/05, Robert Kern [EMAIL PROTECTED] wrote: I would suggest not speculating on biased or malicious intentions. It is possible that no one applied with a proposal to work on Dabo, or that such a proposal was poorly written, or that the author had too little experience, or any number of

Re: What are the other options against Zope?

2005-07-03 Thread Mike Meyer
Christopher Subich [EMAIL PROTECTED] writes: That, and the file format definitely isn't robust to bit-rot that happened too often on FAT16/32 filesystems. From where I sit, the critical difference between the registry and a set of .ini files (or Unix rc files) is that the registry requires

Re: need to get an index for an item in a list

2005-07-03 Thread nephish
Hey, thanks, this has worked out for me. i am trying to do as much of this as possible in IDLE because it lets me know on the fly what is messed up. thanks for your help shawn -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >