ooo2any: Batch convert office documents with openoffice.org

2006-05-14 Thread Thomas Guettler
ooo2any.py is a small script to convert office documents with openoffice.org. It can read and write any format which is supported by openoffice. It uses pyuno to connect to a running openoffice process. It is developed on linux but should be portable to windows, too.

Python API, Initialization, Path and classes

2006-05-14 Thread nojhan
I'm trying to embbed the python interpreter as a class attribute, initializing it in the constructor, and finalizing in destructor. The code is rather simple: // base_path is an attribute of the class, // initialized with argv[0] at the instanciation clog Python base program name asked:

Re: Question regarding checksuming of a file

2006-05-14 Thread Ant
A script I use for comparing files by MD5 sum uses the following function, which you may find helps: def getSum(self): md5Sum = md5.new() f = open(self.filename, 'rb') for line in f: md5Sum.update(line) f.close() return

Re: Cellular automata and image manipulation

2006-05-14 Thread defcon8
Thank you very much. That is highly simple, useful and it works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question regarding checksuming of a file

2006-05-14 Thread Paul Rubin
Ant [EMAIL PROTECTED] writes: def getSum(self): md5Sum = md5.new() f = open(self.filename, 'rb') for line in f: md5Sum.update(line) f.close() return md5Sum.hexdigest() This should work, but there is one hazard if the file is very large

Re: Cellular automata and image manipulation

2006-05-14 Thread defcon8
It seemed to work with a 1d list but not with 2d. -- http://mail.python.org/mailman/listinfo/python-list

Re: Cellular automata and image manipulation

2006-05-14 Thread defcon8
import Image x = [] buff = [] buff = [[0 for y in range(41)] for x in range(21)] buff[0][(len(buff)-1)/2] = 1 def rule1(): for i in range(len(buff)-1): for j in range(len(buff[0])-1): if i == len(buff)-1: break elif j == 0: if

Re: Named regexp variables, an extension proposal.

2006-05-14 Thread Paddy
John Machin wrote: On 13/05/2006 7:39 PM, Paddy wrote: [snip] Extension; named RE variables, with arguments === In this, all group definitions in the body of the variable definition reference the literal contents of groups appearing after the variable

Re: Cellular automata and image manipulation

2006-05-14 Thread defcon8
Sorry this is the latest, the previous didn't work so well: import Image x = [] buff = [] buff = [[0 for y in range(41)] for x in range(21)] buff[0][(len(buff[0])-1)/2] = 1 def rule1(): for i in range(len(buff)-1): for j in range(len(buff[0])-1): if i == len(buff)-1:

Re: Cellular automata and image manipulation

2006-05-14 Thread defcon8
Actually never mind either. I guessed I needed to append all values after eachother in one row list: x = [] for y in buff: for z in y: x.append(z) thanks for the help -- http://mail.python.org/mailman/listinfo/python-list

Re: Named regexp variables, an extension proposal.

2006-05-14 Thread Paddy
Paul McGuire wrote: Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Proposal: Named RE variables == Hi Paul, please also refer to my reply to John. By contrast, the event declaration expression in the pyparsing Verilog parser is: identLead =

Re: cx_freeze and matplotlib

2006-05-14 Thread Flavio
My application needs needs matplotlib. So cx_Freeze bundles it in. But it only bundles matplotlib python modules, not its data files! In the original machine I believe that the frozen executable is somehow finding those datafiles in their original locations, which is not desirable, ecause the

send an email with picture/rich text format in the body

2006-05-14 Thread anya
Hey, I have a certain problem and till now I didnt find an answer on the web. I want to send an email message with picture in it. I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the picture.. (it is possible that the solution will

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Ben Finney
anya [EMAIL PROTECTED] writes: I want to send an email message with picture in it. Please, reconsider. Email is a text medium. I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the picture.. No, they won't; my email client

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 13:24 schrieb anya: I want to send an email message with picture in it. This... I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the picture.. will... (it is possible that the solution will be in

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Astan Chee
what about sending the mail as html instead of normal plain/text ? anya wrote: Hey, I have a certain problem and till now I didnt find an answer on the web. I want to send an email message with picture in it. I dont want to put it as attachment but make it in the body of the mail, so every one

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Miki
Hello Anya, See http://docs.python.org/lib/node597.html IMO if you'll place the picture as 1'st MutliMime part the *some* email readers will show it like you want. HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Ben Finney
Miki [EMAIL PROTECTED] writes: See http://docs.python.org/lib/node597.html IMO if you'll place the picture as 1'st MutliMime part the *some* email readers will show it like you want. And most good spam filters will recognise it for the junk that it is, and flag it appropriately. Messages

Re: any plans to make pprint() a builtin?

2006-05-14 Thread Duncan Booth
John Salerno wrote: Just wondering if this will ever happen, maybe in 3.0 when print becomes a function too? It would be a nice option to have it available without importing it every time, but maybe making it a builtin violates some kind of pythonic ideal? There are so many things which

Re: Is there any pure python webserver that can use FCGI

2006-05-14 Thread Miki
Hello llothar, IIRC trac (http://www.edgewall.com/trac/) is pure python, have a web server and support FCGI HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils and binding a script to a file extension on windows

2006-05-14 Thread Miki
Hello Alex, Not really an answer but if you use InnoSetup (http://www.jrsoftware.org/) you can set file type association (see http://www.jrsoftware.org/isfaq.php) HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Ten
On Sunday 14 May 2006 12:24, anya wrote: Hey, I have a certain problem and till now I didnt find an answer on the web. I want to send an email message with picture in it. I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the

Re: any plans to make pprint() a builtin?

2006-05-14 Thread Tim Golden
Duncan Booth wrote: John Salerno wrote: Just wondering if this will ever happen, maybe in 3.0 when print becomes a function too? It would be a nice option to have it available without importing it every time, but maybe making it a builtin violates some kind of pythonic ideal? There

Re: retain values between fun calls

2006-05-14 Thread Kent Johnson
George Sakkis wrote: Gary Wessle wrote: Hi the second argument in the functions below suppose to retain its value between function calls, the first does, the second does not and I would like to know why it doesn't? and how to make it so it does? thanks # it does def f(a, L=[]):

Re: any plans to make pprint() a builtin?

2006-05-14 Thread Kent Johnson
Duncan Booth wrote: Personally I'd just like to see 'python' a builtin shorthand for importing a name you aren't going to use much e.g. python.pprint.pprint(x) Would you settle for import py py.std.pprint.pprint(x) ? http://codespeak.net/py/current/doc/misc.html#the-py-std-hook Kent

Re: State of the Vaults of Parnassus

2006-05-14 Thread Mike C. Fletcher
Christoph Zwerschke wrote: Does anybody know what happened to the Vaults of Parnassus site at http://www.vex.net/~x/parnassus/? Dr Dobb's weekly Python news still claims that it ambitiously collects references to all sorts of Python resources. But I have the impression that it does not do

Re: copying files into one

2006-05-14 Thread Ten
On Sunday 14 May 2006 05:09, Gary Wessle wrote: Hi I am looping through a directory and appending all the files in one huge file, the codes below should give the same end results but are not, I don't understand why the first code is not doing it. thanks Hi there - I think you might need

Re: do/while structure needed

2006-05-14 Thread Ten
On Sunday 14 May 2006 06:17, John Salerno wrote: 1 random.shuffle(letters) 2 trans_letters = ''.join(letters)[:len(original_set)] 3 trans_table = string.maketrans(original_set, trans_letters) So what I'd like to do is have lines 1 and 2 run once, then I want to do some comparison between

Re: any plans to make pprint() a builtin?

2006-05-14 Thread Duncan Booth
Tim Golden wrote: Duncan Booth wrote: Personally I'd just like to see 'python' a builtin shorthand for importing a name you aren't going to use much e.g. python.pprint.pprint(x) I think that's what the py.lib people have done with their py.std module:

SQl to HTML report generator

2006-05-14 Thread George Sakkis
I'm kinda surprised that while many web frameworks provide both some ORM and a template language, they do very little to combine them into higher level blocks, like report generation. So I'm wondering if I have missed any toolkit out there that can 1) take a SQL select (either raw or the

Re: Aggregate funuctions broken in MySQLdb?

2006-05-14 Thread Wade Leftwich
Works fine for me, and I certainly hope MySQLdb is ready for prime time, because I use the heck out of it. Maybe you're getting fooled by the fact that cursor.execute() returns the count of result rows. To actually see the result rows, you have to say cursor.fetchone() or fetchall() -- In [34]:

Re: count items in generator

2006-05-14 Thread Alex Martelli
Paul Rubin http://[EMAIL PROTECTED] wrote: George Sakkis [EMAIL PROTECTED] writes: As clunky as it seems, I don't think you can beat it in terms of brevity; if you care about memory efficiency though, here's what I use: def length(iterable): try: return len(iterable) except:

Starting/launching eric3

2006-05-14 Thread Byte
Decided to try the eric3 IDE, but I cant figure out how to start it! When I extract the file, all I can see is a ton of files and Python scripts. What script will run the program? Where is it? Please help! -- /usr/bin/byte -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting/launching eric3

2006-05-14 Thread Byte
OK, now I've managed to get it working, but when I run it the eric3 splash screen pops up, and then it says (in terminal): [EMAIL PROTECTED]:~$ eric3 Traceback (most recent call last): File /usr/lib/site-python/eric3/eric3.py, line 147, in ? main() File

Re: count items in generator

2006-05-14 Thread Cameron Laird
In article [EMAIL PROTECTED], Alex Martelli [EMAIL PROTECTED] wrote: . . . My preference would be (with the original definition for words_of_the_file) to code numwords = sum(1 for w in words_of_the_file(thefilepath))

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Edward Elliott
anya wrote: I want to send an email message with picture in it. I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the picture.. Step 1: convert image to ascii art Step 2: send Step 3: hope recipient uses a fixed-width font --

Re: count items in generator

2006-05-14 Thread Paul Rubin
[EMAIL PROTECTED] (Cameron Laird) writes: For that matter, would it be an advantage for len() to operate on iterables? print len(itertools.count()) Ouch!! -- http://mail.python.org/mailman/listinfo/python-list

The best way of calculating and adding a block check character to a string

2006-05-14 Thread H J van Rooyen
Hi All I am new to this language, and in using it to drive a serial port, I need to calculate classic block check characters - for the veterans amongst you - think "Burroughs Poll Select" or "Uniscope"... This is a program fragment that puts the string in an array of Bytes - is there a

continue out of a loop in pdb

2006-05-14 Thread Gary Wessle
Hi using the debugger, I happen to be on a line inside a loop, after looping few times with n and wanting to get out of the loop to the next line, I set a break point on a line after the loop structure and hit c, that does not continue out of the loop and stop at the break line, how is it down, I

Re: Named regexp variables, an extension proposal.

2006-05-14 Thread Paul McGuire
Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's difficult to switch to parsers for me even though examples like pyparsing seem readable, I do want to skip what I am not interested in rather than having to write a parser for everything. But converely, when something skipped

Re: do/while structure needed

2006-05-14 Thread Paul McGuire
Ten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 14 May 2006 06:17, John Salerno wrote: 1 random.shuffle(letters) 2 trans_letters = ''.join(letters)[:len(original_set)] 3 trans_table = string.maketrans(original_set, trans_letters) So what I'd like to do is have

Re: Named regexp variables, an extension proposal.

2006-05-14 Thread Paddy
I have another use case. If you want to match a comma separated list of words you end up writing what constitutes a word twice, i.e: r\w+[,\w+] As what constitues a word gets longer, you have to repeat a longer RE fragment so the fact that it is a match of a comma separated list is lost, e.g:

Re: continue out of a loop in pdb

2006-05-14 Thread Paul McGuire
Gary Wessle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi using the debugger, I happen to be on a line inside a loop, after looping few times with n and wanting to get out of the loop to the next line, I set a break point on a line after the loop structure and hit c, that does

Re: do/while structure needed

2006-05-14 Thread John Salerno
George Sakkis wrote: while True: random.shuffle(letters) trans_letters = ''.join(letters)[:len(original_set)] if some_compatison(original_set,trans_letters): trans_table = string.maketrans(original_set, trans_letters) break Thanks, that looks pretty good.

Re: any plans to make pprint() a builtin?

2006-05-14 Thread John Salerno
Kent Johnson wrote: Duncan Booth wrote: Personally I'd just like to see 'python' a builtin shorthand for importing a name you aren't going to use much e.g. python.pprint.pprint(x) Would you settle for import py py.std.pprint.pprint(x) ?

Re: count items in generator

2006-05-14 Thread BartlebyScrivener
True. Changing the except clause here to except: return sum(1 for x in iterable) keeps George's optimization (O(1), not O(N), for containers) and is a bit faster (while still O(N)) for non-container iterables. Every thing was going just great. Now I have to think again. Thank you all.

Re: Question regarding checksuming of a file

2006-05-14 Thread Andrew Robert
When I run the script, I get an error that the file object does not have the attribute getblocks. Did you mean this instead? def getblocks(f, blocksize=1024): while True: s = f.read(blocksize) if not s: return yield s def

Re: Question regarding checksuming of a file

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 20:51 schrieb Andrew Robert: def getblocks(f, blocksize=1024): while True: s = f.read(blocksize) if not s: return yield s This won't work. The following will: def getblocks(f,blocksize=1024): while True: s =

Converting hex to char help

2006-05-14 Thread Ognjen Bezanov
Hi all, I am trying to convert a hexdecimal value to a char using this code: print ' %c ' % int(0x62) this works fine, but if I want to do this: number = 62 print ' %c ' % int(0x + number) I get an error: Traceback (most recent call last): File stdin,line 1, in ? ValueError: invalid literal

Re: copying files into one

2006-05-14 Thread Gary Wessle
thanks, I was able 'using pdb' to fix the problem as per Edward's suggestion. -- http://mail.python.org/mailman/listinfo/python-list

Re: Named regexp variables, an extension proposal.

2006-05-14 Thread Paul McGuire
Paddy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have another use case. If you want to match a comma separated list of words you end up writing what constitutes a word twice, i.e: r\w+[,\w+] As what constitues a word gets longer, you have to repeat a longer RE fragment so

Re: Converting hex to char help

2006-05-14 Thread Sybren Stuvel
Ognjen Bezanov enlightened us with: Hi all, I am trying to convert a hexdecimal value to a char using this code: print ' %c ' % int(0x62) This is an integer this works fine, but if I want to do this: number = 62 print ' %c ' % int(0x + number) This is a string ^

Re: Converting hex to char help

2006-05-14 Thread Tim Chase
How can I convert a string 0x62 to int/hex without this problem? The call to int() takes an optional parameter for the base: print int.__doc__ int(x[, base]) - integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this

Re: Converting String to int

2006-05-14 Thread Ognjen Bezanov
Hi all, Another problem, with the same error (error: invalid literal for int()) code: mynums = 423.523.674.324.342.122.943.421.762.158.830 mynumArray = string.split(mynums,.) x = 0 for nums in mynumArray: if nums.isalnum() == true: x = x + int(nums) else: print Error,

Re: Question regarding checksuming of a file

2006-05-14 Thread Paul Rubin
Andrew Robert [EMAIL PROTECTED] writes: When I run the script, I get an error that the file object does not have the attribute getblocks. Woops, yes, you have to call getblocks(f). Also, Heiko says you can't use return to break out of the generator; I thought you could but maybe I got

Re: Converting String to int

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 22:23 schrieb Ognjen Bezanov: mynums = 423.523.674.324.342.122.943.421.762.158.830 mynumArray = string.split(mynums,.) This is the old way of using string functions using the module string. You should only write this as: mynumArray = mynums.split(.) (using the string

Re: continue out of a loop in pdb

2006-05-14 Thread Gary Wessle
Paul McGuire [EMAIL PROTECTED] writes: Gary Wessle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi using the debugger, I happen to be on a line inside a loop, after looping few times with n and wanting to get out of the loop to the next line, I set a break point on a line

help using smptd

2006-05-14 Thread Edward Elliott
I'm having trouble using the smptd module. The docs are woefully inadequate and inspecting the source didn't help either. So far I've figured out how to subclass smtpd.SMTPServer and override the process_message method to handle smtp messages. I create an instance of my server and it listens on

Re: Named regexp variables, an extension proposal.

2006-05-14 Thread Edward Elliott
Paddy wrote: I have another use case. If you want to match a comma separated list of words you end up writing what constitutes a word twice, i.e: r\w+[,\w+] That matches one or more alphanum characters followed by exactly one comma, plus, or alphanum. I think you meant r'\w+(,\w+)*' or

Re: Question regarding checksuming of a file

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 22:29 schrieb Paul Rubin: Andrew Robert [EMAIL PROTECTED] writes: When I run the script, I get an error that the file object does not have the attribute getblocks. Woops, yes, you have to call getblocks(f). Also, Heiko says you can't use return to break out of the

Re: help using smptd

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 23:47 schrieb Dennis Lee Bieber: On Sun, 14 May 2006 20:47:33 GMT, Edward Elliott [EMAIL PROTECTED] declaimed the following in comp.lang.python: class SMTPProxy (smtpd.SMTPServer): Don't you need to have an __init__() that invokes SMTPServer's __init__()? If

Re: count items in generator

2006-05-14 Thread George Sakkis
Paul Rubin wrote: [EMAIL PROTECTED] (Cameron Laird) writes: For that matter, would it be an advantage for len() to operate on iterables? print len(itertools.count()) Ouch!! How is this worse than list(itertools.count()) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: count items in generator

2006-05-14 Thread Alex Martelli
Cameron Laird [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Alex Martelli [EMAIL PROTECTED] wrote: . . . My preference would be (with the original definition for words_of_the_file) to code numwords = sum(1 for

Re: count items in generator

2006-05-14 Thread Alex Martelli
George Sakkis [EMAIL PROTECTED] wrote: Paul Rubin wrote: [EMAIL PROTECTED] (Cameron Laird) writes: For that matter, would it be an advantage for len() to operate on iterables? print len(itertools.count()) Ouch!! How is this worse than list(itertools.count()) ? It's a

RE: count items in generator

2006-05-14 Thread Delaney, Timothy (Tim)
George Sakkis wrote: Paul Rubin wrote: [EMAIL PROTECTED] (Cameron Laird) writes: For that matter, would it be an advantage for len() to operate on iterables? print len(itertools.count()) Ouch!! How is this worse than list(itertools.count()) ? list(itertools.count()) will

RE: count items in generator

2006-05-14 Thread Delaney, Timothy (Tim)
Delaney, Timothy (Tim) wrote: Actually len(itertools.count()) would as well - when a couple of long instances used up everything available - but it would take a *lot* longer. Actually, this would depend on whether len(iterable) used a C integral variable to accumulate the length (which would

Re: continue out of a loop in pdb

2006-05-14 Thread Diez B. Roggisch
the code works with no problem, I am playing around with the pdb, i.e from pdb import * set_trace() for i in range(1,50): print i print tired of this print I am out [EMAIL PROTECTED]:~/python/practic$ python practic.py

comparing values in two sets

2006-05-14 Thread John Salerno
I'd like to compare the values in two different sets to test if any of the positions in either set share the same value (e.g., if the third element of each set is an 'a', then the test fails). I have this: def test_sets(original_set, trans_letters): for pair in zip(original_set,

Re: comparing values in two sets

2006-05-14 Thread skip
John I'd like to compare the values in two different sets to test if John any of the positions in either set share the same value (e.g., if John the third element of each set is an 'a', then the test fails). Do you really mean set and not list? Note that they are unordered. These

Re: count items in generator

2006-05-14 Thread Paul Rubin
Delaney, Timothy (Tim) [EMAIL PROTECTED] writes: Actually len(itertools.count()) would as well - when a couple of long instances used up everything available - but it would take a *lot* longer. Actually, this would depend on whether len(iterable) used a C integral variable to accumulate

RE: count items in generator

2006-05-14 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: That's only because itertools.count itself uses a C int instead of a long. True. In either case, the effect is the same in terms of whether len(itertools.count()) will ever terminate. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: comparing values in two sets

2006-05-14 Thread bearophileHUGS
Note that you are comparing ordered sequences, like lists, tuples, strings, etc, and not sets. Something like this can be a little improvement of your code, it avoids building the zipped list, and scans the iterable unpacking it on the fly: from itertools import izip def test_sets(original_set,

Re: any plans to make pprint() a builtin?

2006-05-14 Thread pjw
It has been proposed to replace the current print statement with a print function for python 3.0. http://www.python.org/dev/peps/pep-3100/ From BDFL state of the python union: print x, y, x becomes print(x, y, z) print f, x, y, z becomes print(x, y, z, file=f) --

Re: comparing values in two sets

2006-05-14 Thread bearophileHUGS
So you probably have to change the function test_sets name, because it's not much useful on real sets. Can't you use the == or != operators on those sequences? Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: comparing values in two sets

2006-05-14 Thread John Machin
John Salerno wrote: I'd like to compare the values in two different sets to test if any of the positions in either set share the same value (e.g., if the third element of each set is an 'a', then the test fails). I have this: def test_sets(original_set, trans_letters): for pair in

Re: Threads

2006-05-14 Thread placid
Dennis Lee Bieber wrote: On Fri, 12 May 2006 14:30:12 -, Grant Edwards [EMAIL PROTECTED] declaimed the following in comp.lang.python: On 2006-05-12, Sybren Stuvel [EMAIL PROTECTED] wrote: placid enlightened us with: Did you read the documentation for Queue methods?

Re: comparing values in two sets

2006-05-14 Thread Tim Chase
I'd like to compare the values in two different sets to test if any of the positions in either set share the same value (e.g., if the third element of each set is an 'a', then the test fails). There's an inherant problem with this...sets by definition are unordered, much like dictionaries.

Re: Converting String to int

2006-05-14 Thread Tim Chase
Hi all, Another problem, with the same error (error: invalid literal for int()) Having the actual code would be helpful... code: mynums = 423.523.674.324.342.122.943.421.762.158.830 mynumArray = string.split(mynums,.) x = 0 for nums in mynumArray: if nums.isalnum() == true:

Re: comparing values in two sets

2006-05-14 Thread Paul Rubin
John Salerno [EMAIL PROTECTED] writes: I'd like to compare the values in two different sets to test if any of the positions in either set share the same value (e.g., if the third element of each set is an 'a', then the test fails). I think by sets you mean lists. Sets are unordered, as a few

Re: A critic of Guido's blog on Python's lambda

2006-05-14 Thread Lasse Rasinen
Ken Tilton [EMAIL PROTECTED] writes: ps. flaming aside, PyCells really would be amazingly good for Python. And so Google. (Now your job is on the line. g) k Here's something I wrote this week, mostly as a mental exercise ;-) The whole code is available at http://www.iki.fi/~lrasinen/cells.py,

Re: comparing values in two sets

2006-05-14 Thread John Salerno
John Salerno wrote: I'd like to compare the values in two different sets Oops, I guess I was a little too loose in my use of the word 'set'. I'm using sets in my program, but by this point they actually become strings, so I'm really comparing strings. Thanks for pointing that out to me, and

Windows Copy Gui

2006-05-14 Thread placid
Hi all, Just wondering if anyone knows how to pop up the dialog that windows pops up when copying/moving/deleting files from one directory to another, in python ? Cheers -- http://mail.python.org/mailman/listinfo/python-list

Tabs versus Spaces in Source Code

2006-05-14 Thread Xah Lee
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this

Re: count items in generator

2006-05-14 Thread George Sakkis
Delaney, Timothy (Tim) wrote: George Sakkis wrote: Paul Rubin wrote: [EMAIL PROTECTED] (Cameron Laird) writes: For that matter, would it be an advantage for len() to operate on iterables? print len(itertools.count()) Ouch!! How is this worse than list(itertools.count())

RE: count items in generator

2006-05-14 Thread Delaney, Timothy (Tim)
George Sakkis wrote: Delaney, Timothy (Tim) wrote: list(itertools.count()) will eventually fail with a MemoryError. That's more of a theoretical argument on why the latter is worse. How many real-world programs are prepared for MemoryError every time they call list(), catch it and handle

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread Bryan
Xah Lee wrote: Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread Eli Gottlieb
Actually, spaces are better for indenting code. The exact amount of space taken up by one space character will always (or at least tend to be) the same, while every combination of keyboard driver, operating system, text editor, content/file format, and character encoding all change precisely

Problem with Tkinter on Mac OS X

2006-05-14 Thread Jean Richelle
Hello, I installed version 2.4.1 (and I tried also with 2.4.3) of Python under 10.3.9 (and 10.4.6), and I trying to use Tkinter. For simplicity I'm testing the hello world that I found in the documentation. I first launch IDLE, write (cut and paste from the web) the program in an

Re: help using smptd

2006-05-14 Thread Edward Elliott
Heiko Wundram wrote: If you don't define an __init__() yourself (as it seems to be the case here), MRO (and the rules associated with class methods) will take care that the base class' __init__() gets called automatically. Yes __init__ is being called. smtpd.PureProxy doesn't define its own

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread Edward Elliott
Eli Gottlieb wrote: Actually, spaces are better for indenting code. The exact amount of space taken up by one space character will always (or at least tend to be) the same, while every combination of keyboard driver, operating system, text editor, content/file format, and character encoding

Re: help using smptd

2006-05-14 Thread Edward Elliott
Edward Elliott wrote: import smtpd class SMTPProxy (smtpd.SMTPServer): def process_message (self, peer, mailfrom, rcpttos, data): # my code here proxy = SMTPProxy (listen_addr, relay_addr) # now what? Update: I think I've solved it. SMTPServer registers with asyncore, so

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread John McMonagle
Personally, I don't think it matters whether you use tabs or spaces for code indentation. As long as you are consistent and do not mix the two. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. --

Re: A critic of Guido's blog on Python's lambda

2006-05-14 Thread Ken Tilton
Lasse Rasinen wrote: Ken Tilton [EMAIL PROTECTED] writes: ps. flaming aside, PyCells really would be amazingly good for Python. And so Google. (Now your job is on the line. g) k Here's something I wrote this week, mostly as a mental exercise ;-) It's fun, right? But what you have is a

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread Chris Klaiber
On 5/14/06, Edward Elliott [EMAIL PROTECTED] wrote: Eli Gottlieb wrote: Actually, spaces are better for indenting code.The exact amount of space taken up by one space character will always (or at least tend to be) the same, while every combination of keyboard driver, operating system, text

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread David Steuber
Spaces work better. Hitting the TAB key in my Emacs will auto-indent the current line. Only spaces will be used for fill. The worst thing you can do is mix the two regardless of how you feel about tab vs space. The next step in evil is to give tab actual significance like in make. Xah Lee is

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread jmcgill
If I work on your project, I follow the coding and style standards you specify. Likewise if you work on my project you follow the established standards. Fortunately for you, I am fairly liberal on such matters. I like to see 4 spaces for indentation. If you use tabs, that's what I will

Re: A critic of Guido's blog on Python's lambda

2006-05-14 Thread Lasse Rasinen
Ken Tilton [EMAIL PROTECTED] writes: if any concepts have survived to the Python version. Since Python's object model is sufficiently different, the system is based on rules being defined per-class... That will be a total disaster for PyCells, if true. But I do not think it is. You just

[ python-Feature Requests-1080727 ] Add encoding to DocFileSuite

2006-05-14 Thread SourceForge.net
Feature Requests item #1080727, was opened at 2004-12-08 01:47 Message generated for change (Comment added) made by quiver You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=355470aid=1080727group_id=5470 Please note that this message will contain a full copy of the

[ python-Bugs-1324799 ] Curses module doesn't install on Solaris 2.8

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

[ python-Bugs-1199282 ] subprocess _active.remove(self) self not in list _active

2006-05-14 Thread SourceForge.net
Bugs item #1199282, was opened at 05/10/05 11:24 Message generated for change (Comment added) made by sf-robot You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1199282group_id=5470 Please note that this message will contain a full copy of the comment

  1   2   >