Re: Tricky Dictionary Question from newbie

2005-07-12 Thread Tim Peters
[Peter Hansen] ... I suppose I shouldn't blame setdefault() itself for being poorly named, No, you should blame Guido for that wink. but it's confusing to me each time I see it in the above, because the name doesn't emphasize that the value is being returned, and yet that fact is arguably

Re: Creating anonymous functions using eval

2005-07-12 Thread Steven D'Aprano
On Tue, 12 Jul 2005 08:28:45 -0700, Devan L wrote: How is this different from a nested function? Well, this is a newsgroup posting written by you. Nested functions in Python are callable objects that exist as attributes of other callable objects, so the two are very different. Alternatively,

Re: Search Replace with RegEx

2005-07-12 Thread [EMAIL PROTECTED]
thanks for the comments + help. i think i got it working, although it's not pretty: ## import os import re theRegEx = '.*abs:.*\.*.' p = re.compile(theRegEx, re.IGNORECASE) fileToSearch = 'compreg.dat' print File to perform search-and-replace on: +

Re: automatic form filling

2005-07-12 Thread harold fellermann
I would like to know how I could automatically fill a (search) form on a web page and download the resulting html page. More precisely I would like to make a program that would automatically fill the Buscador lista 40 (in spanish, sorry) form in the following webpage:

Re: automatic form filling

2005-07-12 Thread Daniel Dittmar
I would like to know how I could automatically fill a (search) form on a web page and download the resulting html page. http://wwwsearch.sourceforge.net/ClientForm/ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with inverted dictionary

2005-07-12 Thread Steven D'Aprano
On Tue, 12 Jul 2005 08:25:50 -0700, rorley wrote: OK, so my problem is I have a text file with all of these instances, for example 5000 facts about animals. I need to go through the file and put all of the facts (lines) that contain the word lion into a file called lion.txt. If I come

Re: Creating anonymous functions using eval

2005-07-12 Thread Devan L
Well, the string that gets passed is more or less a function definition, which is then called with exec. I don't see why you'd need to write a string out with the function definition and then call it. You could just write the function. As for the nested functions, I had been presuming that it was

Re: Inconsistency in hex()

2005-07-12 Thread [EMAIL PROTECTED]
Steven D'Aprano wrote: hex() of an int appears to return lowercase hex digits, and hex() of a long uppercase. hex(75) '0x4b' hex(75*256**4) '0x4BL' By accident or design? Apart from the aesthetic value that lowercase hex digits are ugly, should we care? No, just use GMPY.

Re: automatic form filling

2005-07-12 Thread ulrice jardin
Thanks A LOT for your help! __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does reply to messages on this list put the sender in the To

2005-07-12 Thread Rocco Moretti
Peter Decker wrote: On 7/12/05, Dark Cowherd [EMAIL PROTECTED] wrote: Most lists when i hit reply it puts the list address back in the To address and some lists allow you to configure this. But in this list reply sends the mail back as a private mail and there seems to be no option to

Re: Web App like Google

2005-07-12 Thread Graham Fawcett
In translating natural language to SQL, be sure you're not introducing opportunities for SQL injection attacks. Code like sql = 'SELECT %s FROM %s' % (this, that) is considered dangerous, because a well-crafted value for that can be used to, e.g., delete rows from your tables, run system

Re: Help with inverted dictionary

2005-07-12 Thread Dark Cowherd
As Steven said this looks too much like home work But what the heck I am also learning python. So I wrote a small program. A very small program. I am fairly new to Python, I am stunned each time to see how small programs like this can be. Since I am also learning can somebody comment if anything

Re: Help with inverted dictionary

2005-07-12 Thread rorley
Not quite homework but a special project. Thanks for the advice. I'll let you know if I run into anymore stumbling blocks. Reece -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficiency of using long integers to hold bitmaps

2005-07-12 Thread Jeff Melvaine
Bengt, Thanks for your informative reply, further comments interleaved. Bengt Richter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 11 Jul 2005 02:37:21 +1000, Jeff Melvaine [EMAIL PROTECTED] wrote: I note that I can write expressions like 1 100 and the result is

Re: Help with inverted dictionary

2005-07-12 Thread rorley
Thanks for the hints, I think I've figured it out. I've only been using Python for 2 days so I really needed the direction. If you were curious, this is not homework but an attempt to use the ConceptNet data (its an MIT AI project) to make a website in a Wiki-like format that would allow the

Re: Environment Variable

2005-07-12 Thread tuxlover
No, the replies from Grant's and Sybren's do answer my question. I posted twice because my browser locked itself up, and I ended up typing twice :( -- http://mail.python.org/mailman/listinfo/python-list

pywin32 com server cash question

2005-07-12 Thread Philippe C. Martin
Hi, I just got the pywin32 hello world COM server to install and I did manage to use it from VB 6.0. However, there are some glitches I do not comprehend: 1) at one point I got a python runtime error telling me the testcomserver was not found - I got rid of that problem by deleteting the

Re: pywin32 com server cash question

2005-07-12 Thread Philippe C. Martin
Sorry: Cache, not Cash Philippe C. Martin wrote: Hi, I just got the pywin32 hello world COM server to install and I did manage to use it from VB 6.0. However, there are some glitches I do not comprehend: 1) at one point I got a python runtime error telling me the testcomserver was

Re: Inconsistency in hex()

2005-07-12 Thread Dan Bishop
Steven D'Aprano wrote: hex() of an int appears to return lowercase hex digits, and hex() of a long uppercase. hex(75) '0x4b' hex(75*256**4) '0x4BL' By accident or design? Apart from the aesthetic value that lowercase hex digits are ugly, should we care? It would also be nice

python parser

2005-07-12 Thread tuxlover
Hello everyone I have to write a verilog parser in python for a class project. I was wondering if all you folks could advise me on choosing the right python parser module. I am not comfortable with lex/yacc and as a result find myself strugging with any module which use lex/yacc

Re: removing list comprehensions in Python 3.0

2005-07-12 Thread Steven Bethard
Steven Bethard wrote: py def ge(items): ... return (item for item in items if item) ... Bengt Richter wrote: dis.dis(ge) 2 0 LOAD_CONST 1 (code object generator expression at 02EE4FA0, file stdin, line 2) 3 MAKE_FUNCTION0

Re: Efficiency of using long integers to hold bitmaps

2005-07-12 Thread Bengt Richter
On Wed, 13 Jul 2005 03:24:48 +1000, Jeff Melvaine [EMAIL PROTECTED] wrote: Bengt, Thanks for your informative reply, further comments interleaved. Can't reply fully now, but just had the thought that maybe some ideas from 8-queens solvers might be useful or interesting. There is an old thread

Re: Efficiency of using long integers to hold bitmaps

2005-07-12 Thread Jack Diederich
On Wed, Jul 13, 2005 at 03:24:48AM +1000, Jeff Melvaine wrote: Bengt, Thanks for your informative reply, further comments interleaved. Bengt Richter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 11 Jul 2005 02:37:21 +1000, Jeff Melvaine [EMAIL PROTECTED] wrote:

Re: Tricky Dictionary Question from newbie

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 11:52:41 -0400, Tim Peters [EMAIL PROTECTED] wrote: [Peter Hansen] ... I suppose I shouldn't blame setdefault() itself for being poorly named, No, you should blame Guido for that wink. but it's confusing to me each time I see it in the above, because the name doesn't

Re: automatically assigning names to indexes

2005-07-12 Thread George Sakkis
[EMAIL PROTECTED] wrote And what should happen for vectors of size != 3 ? I don't think that a general purpose vector class should allow it; a Vector3D subclass would be more natural for this. That's the 'magic' good idea I'm looking for. I think a unified Vector class for all size

Slicing every element of a list

2005-07-12 Thread Alex Dempsey
Recently I tried to slice every element of a list of strings. First I tried: f = open(export.xls, r) lines = f.readlines() for line in lines: line = line[1:-5] line = line.split('\\t\') This went without returning any errors, but nothing was sliced or split. Next I tried: for i in

Re: Web client, https and session management

2005-07-12 Thread Gregory PiƱero
How's this for an answer, it even uses yahoo in the example! http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/391929 Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing every element of a list

2005-07-12 Thread Gary Herron
Alex Dempsey wrote: Recently I tried to slice every element of a list of strings. First I tried: f = open(export.xls, r) lines = f.readlines() for line in lines: line = line[1:-5] line = line.split('\\t\') This, in fact, did do the operation you expected, but after creating the new

Re: Minor correction July 11, 2005

2005-07-12 Thread Hank Oredson
edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT it jumps strait to the display routine and uses the entered command to begin Should be

Re: Fwd: Should I use if or try (as a matter of speed)?

2005-07-12 Thread Christopher Subich
Dark Cowherd wrote: But one advise that he gives which I think is of great value and is good practice is Always catch any possible exception that might be thrown by a library I'm using on the same line as it is thrown and deal with it immediately. That's fine advice, except for when it's

Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads'C1, C2 and C3'

2005-07-12 Thread Ric Da Force
Hi guys, Thank you all for your input! It was good to see so much convergence in the approach! Again, I think that it speaks loudly for the concise way of doing thins in Python... Anyway, I have typed in all of the solutions and have gained a great understanding of how to do this in future.

Re: python parser

2005-07-12 Thread Christopher Subich
tuxlover wrote: I have to write a verilog parser in python for a class project. I was wondering if all you folks could advise me on choosing the right python parser module. I am not comfortable with lex/yacc and as a result find myself strugging with any module which use lex/yacc

Frankenstring

2005-07-12 Thread Thomas Lotze
Hi, I think I need an iterator over a string of characters pulling them out one by one, like a usual iterator over a str does. At the same time the thing should allow seeking and telling like a file-like object: f = frankenstring(0123456789) for c in f: ... print c ... if c == 2: ...

Re: Searching through a list of tuples

2005-07-12 Thread Scott David Daniels
Peter Otten wrote: Repton wrote: I often find myself storing data in a list of tuples, and I want to ask questions like what is the index of the first tuple whose 3rd element is x, iter(n for n, elem in enumerate(lst) if elem[3] == x).next() or give me the first tuple whose 2nd element

Re: Slicing every element of a list

2005-07-12 Thread Scott David Daniels
Alex Dempsey wrote: Recently I tried to slice every element of a list of strings. First I tried: f = open(export.xls, r) lines = f.readlines() for line in lines: line = line[1:-5] line = line.split('\\t\') This went without returning any errors, but nothing was sliced or

Re: Environment Variable

2005-07-12 Thread Sybren Stuvel
tuxlover enlightened us with: No, the replies from Grant's and Sybren's do answer my question. It would be a lot more polite to actually thank the people helping you. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't

Re: Creating anonymous functions using eval

2005-07-12 Thread Robert Kern
Devan L wrote: Well, the string that gets passed is more or less a function definition, which is then called with exec. I don't see why you'd need to write a string out with the function definition and then call it. You could just write the function. As for the nested functions, I had been

plot module

2005-07-12 Thread Shankar Iyer ([EMAIL PROTECTED])
Hi, I am looking for documentation on the plot module. Does anyone know where I can find this information? Thanks. Shankar -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Should I use if or try (as a matter of speed)?

2005-07-12 Thread Thomas Lotze
Christopher Subich wrote: try: f=file('file_here') except IOError: #File doesn't exist error_handle error_flag = 1 if not error_flag: do_setup_code do_stuff_with(f) which nests on weird, arbitrary error flags, and doesn't seem like good programming to me. Neither

Re: Slicing every element of a list

2005-07-12 Thread Thomas Lotze
Alex Dempsey wrote: for line in lines: line = line[1:-5] line = line.split('\\t\') This went without returning any errors, but nothing was sliced or split. Next I tried: for i in range(len(lines)): lines[i] = lines[i][1:-5] lines[i] = lines[i].split('\\t\') This of

Re: automatically assigning names to indexes

2005-07-12 Thread Devan L
import math class Vector: def __init__(self, coordinates): self.coordinates = coordinates self.magnitude = sum([c**2 for c in coordinates])**0.5 self.direction = getangle(Vector([1]+[0 for i in range(len(coordinates)-1)])) def dotproduct(self, vector):

Re: Trying to come to grips with static methods

2005-07-12 Thread Terry Reedy
| I've been doing a lot of reading about static methods in Python, and possibly getting over-confused by the minutia of the CPython implementation, as well as by the misnomer. Conceptually, a 'static method' is a function attribute of a class that is to be used as a function and not as a method

Re: python parser

2005-07-12 Thread Robert Kern
tuxlover wrote: Hello everyone I have to write a verilog parser in python for a class project. I was wondering if all you folks could advise me on choosing the right python parser module. I am not comfortable with lex/yacc and as a result find myself strugging with any module which use

Re: Creating anonymous functions using eval

2005-07-12 Thread Devan L
You missed Steven's point which is to quote the message to which you are replying. Not everyone is reading this list in a conveniently threaded form, so you need to provide some context for them to be able to follow along. Ah, sorry, I didn't quite get what he was referring to. --

Re: Frankenstring

2005-07-12 Thread Mike C. Fletcher
Thomas Lotze wrote: Hi, I think I need an iterator over a string of characters pulling them out one by one, like a usual iterator over a str does. At the same time the thing should allow seeking and telling like a file-like object: Okay, first off, this is never going to be *fast* compared

Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads'C1, C2 and C3'

2005-07-12 Thread Bengt Richter
On Wed, 13 Jul 2005 03:47:07 +0800, Ric Da Force [EMAIL PROTECTED] wrote: Hi guys, Thank you all for your input! It was good to see so much convergence in the approach! Again, I think that it speaks loudly for the concise way of doing thins in Python... Anyway, I have typed in all of the

Re: Web client, https and session management

2005-07-12 Thread Yannick Turgeon
Well... Thanks for that! The work is almost completed now! ;o) Yannick -- http://mail.python.org/mailman/listinfo/python-list

Re: Inconsistency in hex()

2005-07-12 Thread Terry Reedy
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hex() of an int appears to return lowercase hex digits, and hex() of a long uppercase. Already bug-reported and fixed for 2.5 (to use lowercase, I believe).

Re: Fwd: Should I use if or try (as a matter of speed)?

2005-07-12 Thread Roy Smith
Christopher Subich [EMAIL PROTECTED] wrote: try: f = file('file_here') do_setup_code do_stuff_with(f) except IOError: # File doesn't exist error_handle It's also a good idea to keep try blocks as small as possible, so you know exactly where the error happened. Imagine if

Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads'C1, C2 and C3'

2005-07-12 Thread Alan Green
Ric Da Force wrote: Hi guys, Thank you all for your input! It was good to see so much convergence in the approach! Just for divergence, you can also do this with regular expressions: import re re.sub((.*),(.*), r\1 and\2, C1, C2, C3) 'C1, C2 and C3' Alan. --

Re: Frankenstring

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 22:08:55 +0200, Thomas Lotze [EMAIL PROTECTED] wrote: Hi, I think I need an iterator over a string of characters pulling them out one by one, like a usual iterator over a str does. At the same time the thing should allow seeking and telling like a file-like object: f =

Re: Frankenstring

2005-07-12 Thread Thomas Lotze
jay graves wrote: see StringIO or cStringIO in the standard library. Just as with files, iterating over them returns whole lines, which is unfortunately not what I want. -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: python parser

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 13:30:14 -0700, Robert Kern [EMAIL PROTECTED] wrote: tuxlover wrote: Hello everyone I have to write a verilog parser in python for a class project. I was wondering if all you folks could advise me on choosing the right python parser module. I am not comfortable with

Re: Searching through a list of tuples

2005-07-12 Thread Alan Green
Peter Otten wrote: Repton wrote: I often find myself storing data in a list of tuples, and I want to ask questions like what is the index of the first tuple whose 3rd element is x, or give me the first tuple whose 2nd element is y. items = [(1, a, 10), (2, b, 20), (3, c, 30)] class

Re: Frankenstring

2005-07-12 Thread Scott David Daniels
Thomas Lotze wrote: Hi, I think I need an iterator over a string of characters pulling them out one by one, like a usual iterator over a str does. At the same time the thing should allow seeking and telling like a file-like object: f = frankenstring(0123456789) for c in f: ... print

Re: Earthquake Forecasting Program July 11, 2005

2005-07-12 Thread edgrsprj
Hank Oredson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT What

How to match literal backslashes read from a text file using regular expressions?

2005-07-12 Thread cricfan
I'm parsing a text file to extract word definitions. For example the input text file contains the following content: di.va.gate \'di_--v*-.ga_-t\ vb pas.sim \'pas-*m\ adv : here and there : THROUGHOUT I am trying to obtain words between two literal backslashes (\ .. \). I am not able to match

new division in Pythonwin

2005-07-12 Thread Jive Dadson
I like to use Pythonwin as my desktop calculator. It's bothersome to have to type in from __future__ import division into the interactive window every time I open it. I've tried various ways to attempt to get it to import new division at startup, but no luck. I can get it to execute a file, but

Re: Inconsistency in hex()

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 21:17:07 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: hex() of an int appears to return lowercase hex digits, and hex() of a long uppercase. hex(75) '0x4b' hex(75*256**4) '0x4BL' By accident or design? Apart from the aesthetic value that lowercase hex digits are

Re: Creating anonymous functions using eval

2005-07-12 Thread Joseph Garvin
Robert Kern wrote: Not everyone is reading this list in a conveniently threaded form Why not? Just about every modern newsgroup reader and e-mail app has a threaded view option. -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing every element of a list

2005-07-12 Thread John Machin
Alex Dempsey wrote: Recently I tried to slice every element of a list of strings. First I tried: slice? Interesting terminology. Next problem you have, try posting an example of your input, and your expected output. E.g. repr(input_string): 'foo\tbarre\tzot\tX\n' repr(output_list): ['foo',

Re: Thoughts on Guido's ITC audio interview

2005-07-12 Thread Markus Wankus
Stephen Toledo-Brown wrote: Tony Meyer wrote: Everyone complaining about Eclipse in this thread needs to go try 3.1. The interface is much much much more responsive. The problem with Eclipse, IMO, is Java. I've tried 3.1 on a WinXP machine and, like just about any Java program, it's

Browser plug-in for Python?

2005-07-12 Thread Bill Janssen
Has anyone written a browser plug-in for Python, similar to the Java plug-in that Sun has switched to for applets? Bill -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on Guido's ITC audio interview

2005-07-12 Thread Markus Wankus
Markus Wankus wrote: My opinion - If you aren't willing to try something new, or have an aversion to it in the first place, nothing we can say will change your mind. Correction... *There are some people, who* if they aren't willing to try something new, or have an aversion to it in the

Re: Earthquake Forecasting Program July 11, 2005

2005-07-12 Thread Hank Oredson
edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hank Oredson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] edgrsprj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PROPOSED

Re: How to match literal backslashes read from a text file using regular expressions?

2005-07-12 Thread John Machin
[EMAIL PROTECTED] wrote: I'm parsing a text file to extract word definitions. For example the input text file contains the following content: di.va.gate \'di_--v*-.ga_-t\ vb pas.sim \'pas-*m\ adv : here and there : THROUGHOUT I am trying to obtain words between two literal backslashes (\

Re: Inconsistency in hex()

2005-07-12 Thread Raymond Hettinger
[Steven D'Aprano] hex() of an int appears to return lowercase hex digits, and hex() of a long uppercase. [Terry Reedy] Already bug-reported and fixed for 2.5 (to use lowercase, I believe). http://sourceforge.net/tracker/?group_id=5470atid=105470func=detailaid=1224347 Score another victory

Re: How to match literal backslashes read from a text file using regular expressions?

2005-07-12 Thread George Sakkis
This should give you an idea of how to go about it (needs python 2.3 or newer): import re slashPattern = re.compile(r'\\(.*?)\\') for i,line in enumerate(file(parseinput)): print line, i+1, match = slashPattern.search(line) if match: print matched:, match.group(1) else:

Re: append one file to another

2005-07-12 Thread John Machin
[EMAIL PROTECTED] wrote: Hi, I want to append one (huge) file to another (huge) file. The current way I'm doing it is to do something like: infile = open (infilename, 'r') filestr = infile.read() outfile = open(outfilename, 'a') outfile.write(filestr) I wonder if there is a more

Re: Browser plug-in for Python?

2005-07-12 Thread Jeff Epler
Back in the day there was 'grail', which was a browser in its own right. There may also have been a plug-in for other browsers, but I don't know any real details about them. Python itself has deprecated the 'restricted execution' environment it had in previous versions, because ways to break out

Re: Creating anonymous functions using eval

2005-07-12 Thread Dave Benjamin
Joseph Garvin wrote: Robert Kern wrote: Not everyone is reading this list in a conveniently threaded form Why not? Just about every modern newsgroup reader and e-mail app has a threaded view option. My newsreader supports threading, but the first message I see in this thread is from

Re: Creating anonymous functions using eval

2005-07-12 Thread Robert Kern
Joseph Garvin wrote: Robert Kern wrote: Not everyone is reading this list in a conveniently threaded form Why not? Just about every modern newsgroup reader and e-mail app has a threaded view option. Good point. Allow me to modify my statement: not all newsreaders/email apps thread

if not DEBUG: log = null_log

2005-07-12 Thread Simon Burton
Hi, I'm after a no-op command, so that i can redirect logging commands in performance critical code. Something like this: def log(*args): print args def null_log(*args): pass if not DEBUG: log = null_log is unacceptable because of the overhead of calling functions in python. log (about to

Re: Creating anonymous functions using eval

2005-07-12 Thread Steven D'Aprano
On Tue, 12 Jul 2005 17:17:46 -0600, Joseph Garvin wrote: Robert Kern wrote: Not everyone is reading this list in a conveniently threaded form Why not? Just about every modern newsgroup reader and e-mail app has a threaded view option. Technology as a substitute for manners is it? I

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

2005-07-12 Thread Tim Peters
[Michael Hudson] I doubt anyone else is reading this by now, so I've trimmed quotes fairly ruthlessly :) Damn -- there goes my best hope at learning how large a message gmail can handle before blowing up wink. OK, I'll cut even more. [Michael] Can't we use the stuff defined in Appendix F and

Re: plot module

2005-07-12 Thread Titi Anggono
I just use Gnuplot for plot module. Maybe you can visit http://gnuplot-py.sourceforge.net/ or the mailing list http://lists.sourceforge.net/lists/listinfo/gnuplot-py-users --- Shankar Iyer ([EMAIL PROTECTED]) [EMAIL PROTECTED] wrote: Hi, I am looking for documentation on the plot module.

Re: Help with inverted dictionary

2005-07-12 Thread John Machin
[EMAIL PROTECTED] wrote: I will transfer eventually use a database but is there any way for now you could help me make the text files? Thank you so much. Reece No. There is utterly no reason why you should create 5000 or 3 text files. While you are waiting to get a clue about

Re: Frankenstring

2005-07-12 Thread Thomas Lotze
Scott David Daniels wrote: Now if you want to do it for a file, you could do: for c in thefile.read(): The whole point of the exercise is that seeking on a file doesn't influence iteration over its content. In the loop you suggest, I can seek() on thefile to my heart's

Re: Browser plug-in for Python?

2005-07-12 Thread Bill Janssen
Yes, thanks, back in the day I used Grail and played with rexec. I notice that one of the Summer of Code projects was to recreate rexec, but don't know if it was funded. Presumably a Firefox plug-in for Python would restrict the execution environment in some safe way, and provide some kind of UI

Fredericksburg, VA ZPUG Meeting

2005-07-12 Thread Benji York
When: July 13, 7:30-9:00 PM Where: Zope Corp offices (513 Prince Edward Street; Fredericksburg, VA 22408) Details at http://www.zope.org/Members/poster/fxbgzpug_announce_2 Hope to see you there! -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Multivariable polynomials

2005-07-12 Thread Chris
Does anyone know of a good standalone implementation of multivariable polynomials in python? Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: if not DEBUG: log = null_log

2005-07-12 Thread Steven D'Aprano
On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton wrote: Hi, I'm after a no-op command, so that i can redirect logging commands in performance critical code. Something like this: def log(*args): print args def null_log(*args): pass if not DEBUG: log = null_log is unacceptable

Re: Fwd: Should I use if or try (as a matter of speed)?

2005-07-12 Thread Mike Meyer
Dark Cowherd [EMAIL PROTECTED] writes: But one advise that he gives which I think is of great value and is good practice is Always catch any possible exception that might be thrown by a library I'm using on the same line as it is thrown and deal with it immediately. Yuch. That sort of

Re: new division in Pythonwin

2005-07-12 Thread Mike Meyer
Jive Dadson [EMAIL PROTECTED] writes: I like to use Pythonwin as my desktop calculator. It's bothersome to have to type in from __future__ import division into the interactive window every time I open it. I've tried various ways to attempt to get it to import new division at startup, but no

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

2005-07-12 Thread Steven D'Aprano
(All previous quoting ruthlessly snipped.) A question for Tim Peters, as I guess he'll have the most experience in this sort of thing. With all the cross-platform hassles due to the various C compilers not implementing the IEEE standard completely or correctly, I wonder how much work would be

Re: Help with inverted dictionary

2005-07-12 Thread Steven D'Aprano
On Wed, 13 Jul 2005 11:38:44 +1000, John Machin wrote: [EMAIL PROTECTED] wrote: I will transfer eventually use a database but is there any way for now you could help me make the text files? Thank you so much. Reece No. There is utterly no reason why you should create 5000 or 3 text

Re: if not DEBUG: log = null_log

2005-07-12 Thread Bengt Richter
On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton [EMAIL PROTECTED] wrote: Hi, I'm after a no-op command, so that i can redirect logging commands in performance critical code. Something like this: def log(*args): print args def null_log(*args): pass if not DEBUG: log = null_log is

Re: Fwd: Should I use if or try (as a matter of speed)?

2005-07-12 Thread Christopher Subich
Thomas Lotze wrote: Neither does it to me. What about try: f=file('file_here') except IOError: #File doesn't exist error_handle else: do_setup_code do_stuff_with(f) (Not that I'd want to defend Joel's article, mind you...) That works. I'm still not used to having

Re: Help with report

2005-07-12 Thread ChrisH
You know, this is the most concise example of feature-creep in a specification that I've ever seen. You're right. I'm afraid it's from too much work and too little sleep. I'll try to be more precise next time. Thanks to everyone for their help. Chris --

Re: Frankenstring

2005-07-12 Thread Bengt Richter
On Wed, 13 Jul 2005 03:49:16 +0200, Thomas Lotze [EMAIL PROTECTED] wrote: Scott David Daniels wrote: Now if you want to do it for a file, you could do: for c in thefile.read(): The whole point of the exercise is that seeking on a file doesn't influence iteration over its

Re: extend for loop syntax with if expr like listcompgenexp ?

2005-07-12 Thread Terry Hancock
On Monday 11 July 2005 08:53 pm, Bengt Richter wrote: On Tue, 12 Jul 2005 10:12:33 +1000, John Machin [EMAIL PROTECTED] wrote: Bengt Richter wrote: for x in (x for x in seq if x is not None): Byzantine ... Perhaps not if you wanted to enumerate the selected elements, as in for i,

Re: Defending Python

2005-07-12 Thread Jorey Bump
Jorey Bump wrote: Bruno Desthuilliers [EMAIL PROTECTED] wrote: it's. +1 for this becoming the official name of Python 3000. ;) Monty Python's Flying Circus used to begin with It's... I had read at one time that It's was one of the original names proposed for the troupe/show,

Content violation

2005-07-12 Thread NAV2_SMTP_Gateway
Content violation found in email message. From: python-list@python.org To: [EMAIL PROTECTED] File(s): message.zip Matching filename: message.zip -- http://mail.python.org/mailman/listinfo/python-list

Re: set and frozenset unit tests?

2005-07-12 Thread Jacob Page
Reinhold Birkenfeld wrote: Jacob Page wrote: I'd like to run my code through actual set and frozenset unit tests. Does any such code exist? Is it in pure Python? If so, where can it be obtained? Look at /usr/lib/python2.x/test/ (on unix platforms). Thanks for pointing that to me. For

Re: extend for loop syntax with if expr like listcompgenexp ?

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 23:07:07 -0500, Terry Hancock [EMAIL PROTECTED] wrote: On Monday 11 July 2005 08:53 pm, Bengt Richter wrote: On Tue, 12 Jul 2005 10:12:33 +1000, John Machin [EMAIL PROTECTED] wrote: Bengt Richter wrote: for x in (x for x in seq if x is not None): Byzantine ...

[ python-Bugs-1235266 ] debug info file descriptor of tarfile is inconsistent

2005-07-12 Thread SourceForge.net
Bugs item #1235266, was opened at 2005-07-09 18:24 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1235266group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1229429 ] missing Py_DECREF in PyObject_CallMethod

2005-07-12 Thread SourceForge.net
Bugs item #1229429, was opened at 2005-06-29 03:18 Message generated for change (Comment added) made by mwh You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1229429group_id=5470 Please note that this message will contain a full copy of the comment thread,

[ python-Bugs-1229429 ] missing Py_DECREF in PyObject_CallMethod

2005-07-12 Thread SourceForge.net
Bugs item #1229429, was opened at 2005-06-28 21:18 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1229429group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1229429 ] missing Py_DECREF in PyObject_CallMethod

2005-07-12 Thread SourceForge.net
Bugs item #1229429, was opened at 2005-06-29 03:18 Message generated for change (Settings changed) made by mwh You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1229429group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1232768 ] Mistakes in online docs under 5.3 Pure Embedding

2005-07-12 Thread SourceForge.net
Bugs item #1232768, was opened at 2005-07-05 16:11 Message generated for change (Comment added) made by pterk You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1232768group_id=5470 Please note that this message will contain a full copy of the comment thread,

<    1   2   3   >