Re: How to I restart an interactive session?

2005-03-18 Thread Mike Meyer
"markscottwright" <[EMAIL PROTECTED]> writes: > But, by deleting their namespace entries haven't I effectively unloaded > them? In other words, from the point of the interpreter, isn't the > state at point A and point B the same? > > --- point A: > import os > del __main__.__dict_

Re: Step by step: Compiling extensions with MS Visual C++ Toolkit 2003 - msvccompiler-patch.txt (0/1)

2005-03-18 Thread magoldfish
Is it possible to compile extension modules on windows platforms using MS Visual C++ Express 2005, or Visual Studio 8? If so, how would one modify the instructions posted in this thread? [assume I also have Toolkit 2003 installed, if necessary, for msvcr71.lib] Marcus Mike C. Fletcher wrote: >

program hangs when external process crashes

2005-03-18 Thread Earl Eiland
I'm executing WinRK.exe in a loop using the following code: for x in Files: Command_String = 'C:\Program Files\WinRK\WinRK.exe -create ' + os.path.join(InputDirectory, os.path.splitext(x)[0]) + ' -set compression_method ppmz -setg include_paths none -add ' + os.path.join(InputDirectory, x)

survey of modules to be added to stdlib

2005-03-18 Thread Alia Khouri
This is an informal survey to gauge the community's interest in adding popular modules to the python standard library. In no particular order, here's my personal list of favourites: path.py - Jason Orendorff elementree - Fredrik Lundh ctypes - Thomas Heller psyco - Armin Rigo IPython - Fernando P

Re: survey of modules to be added to stdlib

2005-03-18 Thread "Martin v. Löwis"
Alia Khouri wrote: BTW is there an official set of conditions that have to be met before a module can be accepted into the stdlib? Yes - although this has never been followed to date: In PEP 2, http://www.python.org/peps/pep-0002.html a procedure is defined how new modules can be added. Essentially

Re: Is Python like VB?

2005-03-18 Thread Tom Willis
On Fri, 18 Mar 2005 20:20:19 +, Steve Horsley <[EMAIL PROTECTED]> wrote: > scattered wrote: > > > You are right that VBA isn't being discontinued yet. My own interest in > > learning python is to find a replacement for Excel VBA. I'm a > > mathematician who likes to throw quick programs togeth

PyGTK Popup menu?

2005-03-18 Thread dataangel
I want to make a pygtk app that consists completely of a window. When I run it, a menu should appear where the mouse cursor is. I've been looking at the official pygtk tutorial and documentation, but everything seems to assume that I'm either creating a window to put the menu in (I just want it

Re: setDocumentLocator in validating parser (xmlproc)

2005-03-18 Thread James Kew
"Cees Wesseling" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > it seems that xmlproc, the default Validating parser, in my setup does > not call back to setDocumentLocator. Is there anyway to get a locator > in my handler? It's a known bug with a simple patch -- I don't know why i

ANN: 2005 International Obfuscated Ruby Code Contest (IORCC)

2005-03-18 Thread iorcc
IMMEDIATE RELEASE: Fri Mar 18 16:34:52 CST 2005 LOCATION: http://iorcc.dyndns.org/2005/press/031805.html ANNOUNCEMENT: International Obfuscated Ruby Code Contest (IORCC) Entry Deadline, Midnight on March 31st, 2005 Dear Rubyists, Perlists, Shellists, Cists and Hac

Re: list of unique non-subset sets

2005-03-18 Thread les_ander
OK, so I need to be more precise. Given a list of sets, output the largest list of sets (from this list, order does not matter) such that: 1) there is no set that is a PROPER subset of another set in this list 2) no two sets have exactly the same members (100% overlap) Seems like this problem is m

PyGTK and pyexe

2005-03-18 Thread Viktor
Did anybody managed to "pack", a program that uses pygtk with pyexe? The best result I got was: Pango-ERROR **: file shape.c: line 75 (pango_shape): assertion faled: (glyphs->num_glyphs > 0) aborting... I'm using python2.4, pygtk-2.6.1-1.win32-py2.4, gtk-win32-2.6.4-rc1. Thanks in advance. --

Working with Huge Text Files

2005-03-18 Thread Lorn Davies
Hi there, I'm a Python newbie hoping for some direction in working with text files that range from 100MB to 1G in size. Basically certain rows, sorted by the first (primary) field maybe second (date), need to be copied and written to their own file, and some string manipulations need to happen as w

Re: PyGTK and pyexe

2005-03-18 Thread Tom Cocagne
I used the instructions in the PyGTK FAQ and managed to get it working. Take a look at: http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq21.005.htp Cheers, Rakis Viktor wrote: > Did anybody managed to "pack", a program that uses pygtk with pyexe? > > The best result I got was:

Re: Working with Huge Text Files

2005-03-18 Thread [EMAIL PROTECTED]
Lorn Davies wrote: > Hi there, I'm a Python newbie hoping for some direction in working with > text files that range from 100MB to 1G in size. Basically certain rows, > sorted by the first (primary) field maybe second (date), need to be > copied and written to their own file, and some string manip

Re: list of unique non-subset sets

2005-03-18 Thread Bengt Richter
On 18 Mar 2005 15:46:44 -0800, [EMAIL PROTECTED] wrote: >OK, so I need to be more precise. >Given a list of sets, output the largest list of sets (from this list, >order does not matter) such that: >1) there is no set that is a PROPER subset of another set in this list >2) no two sets have exactly

Python tutorial for LinuxQuestions.org?

2005-03-18 Thread beliavsky
I think a short Python tutorial at LinuxQuestions.org http://www.linuxquestions.org/questions/answers.php?action=viewcat&catid=4 would be a good way of introducing Python to new programmers. There are currently tutorials there for C, C++, and Java that have been viewed thousands of times. Of course

Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Raymond Hettinger
I would like to get everyone's thoughts on two new dictionary methods: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty def appendlist(self, key, *values): try:

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Ivan Van Laningham
Hi All-- Maybe I'm not getting it, but I'd think a better name for count would be add. As in d.add(key) d.add(key,-1) d.add(key,399) etc. Raymond Hettinger wrote: > > I would like to get everyone's thoughts on two new dictionary methods: > > def count(self, value, qty=1): >

Re: list of unique non-subset sets

2005-03-18 Thread Raymond Hettinger
[EMAIL PROTECTED] ] > >OK, so I need to be more precise. > >Given a list of sets, output the largest list of sets (from this list, > >order does not matter) such that: > >1) there is no set that is a PROPER subset of another set in this list > >2) no two sets have exactly the same members (100% ove

Re: survey of modules to be added to stdlib

2005-03-18 Thread Neil Hodgson
Alia Khouri: > ctypes - Thomas Heller I would like this to go in but it won't be added as it allows unsafe code, such as dereferencing bad pointers. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Working with Huge Text Files

2005-03-18 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: It will only be this simple if you can guarantee that the original file is actually sorted by the first field. And if not you can either sort the file ahead of time, or just keep reopening the files in append mode when necessary. You could sort them in memory in your Python

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Mike Rovner
Ivan Van Laningham wrote: Hi All-- Maybe I'm not getting it, but I'd think a better name for count would be add. As in d.add(key) d.add(key,-1) d.add(key,399) etc. IMHO inc (for increment) is better. d.inc(key) add can be read as add key to d Mike -- http://mail.python.org/mailman/listinfo/python-

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Jeff Shannon
Raymond Hettinger wrote: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty I presume that the argument list is a typo, and should actually be def count(self, key, qty=1): ... Correct? Jeff Shanno

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > >I would like to get everyone's thoughts on two new dictionary methods: > >def count(self, value, qty=1): >try: >self[key] += qty >except KeyError: >self[ke

Re: Working with Huge Text Files

2005-03-18 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Lorn Davies wrote: > > Hi there, I'm a Python newbie hoping for some direction in working > with > > text files that range from 100MB to 1G in size. Basically certain > rows, > > sorted by the first (primary) field maybe second (date), need to be > > copied and written t

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Raymond Hettinger
> >def count(self, value, qty=1): [Aahz] > You mean > def count(self, key, qty=1) > > Right? Yes. Also, there is a typo in the final snippet (pure python version of dictionary of dictionaries). It should read: if key not in d: d[key] = {subkey:value} else: d

Re: Working with Huge Text Files

2005-03-18 Thread cwazir
Hi, Lorn Davies wrote: > . working with text files that range from 100MB to 1G in size. > . > XYZ,04JAN1993,9:30:27,28.87,7600,40,0,Z,N > XYZ,04JAN1993,9:30:28,28.87,1600,40,0,Z,N > . I've found that for working with simple large text files like this, nothing beats the plain old buil

Virus in your Mail to empire.support

2005-03-18 Thread root at smtp
The VirusCheck at the IMST generated the following Message: V I R U S A L E R T Our VirusCheck found a Virus (W32/Netsky-Q) in your eMail to "empire.support". This eMail has been deleted ! Now it is on you to check your System for Viruses This Syst

Re: Working with Huge Text Files

2005-03-18 Thread Al Christians
I did some similar stuff way back about 12-15 years ago -- in 640k MS-DOS with gigabyte files on 33 MHz machines. I got good performance, able to bring up any record out of 10 million or so on the screen in a couple of seconds (not using Python, but that should not make much difference, maybe ev

Re: Working with Huge Text Files

2005-03-18 Thread Al Christians
Michael Hoffman wrote: [EMAIL PROTECTED] wrote: It will only be this simple if you can guarantee that the original file is actually sorted by the first field. And if not you can either sort the file ahead of time, or just keep reopening the files in append mode when necessary. You could sort them

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Roose
I like this, it is short, low impact, and makes things more readable. I tend to go with just the literal way of doing it instead of using get and setdefault, which I find awkward. But alas I had a my short, low impact, useful suggestion and I think it died. It was for any() and all() for lists.

Re: survey of modules to be added to stdlib

2005-03-18 Thread Raymond Hettinger
> psyco - Armin Rigo This is platform specific. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Bengt Richter
On Sat, 19 Mar 2005 01:24:57 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: >I would like to get everyone's thoughts on two new dictionary methods: > >def count(self, value, qty=1): >try: >self[key] += qty >except KeyError: >self

Re: survey of modules to be added to stdlib

2005-03-18 Thread Paul Rubin
"Raymond Hettinger" <[EMAIL PROTECTED]> writes: > > psyco - Armin Rigo > This is platform specific. That's ok, there's plenty of platform specific modules in the stdlib already, and this seems like a good one to add. -- http://mail.python.org/mailman/listinfo/python-list

Re: survey of modules to be added to stdlib

2005-03-18 Thread Ron
On 18 Mar 2005 14:16:01 -0800, "Alia Khouri" <[EMAIL PROTECTED]> wrote: >This is an informal survey to gauge the community's interest in adding >popular modules to the python standard library. I would prefer to have a install utility included that retrieves a list of modules we can install, updat

Re: list of unique non-subset sets

2005-03-18 Thread les_ander
Once again my specs were incomplete. By largest I mean exactly what you pointed out as in sum(map(len, setlist)). I think this might work--sorting of the initial list should do the trick. 1) sort the sets by size (in decending order) 2) put the first (largest) into a new list (Lu) for s in Lnew[1:

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Jeff Epler
Maybe something for sets like 'appendlist' ('unionset'?) Jeff pgpCq9GushexV.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-03-18 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 286 open ( +7) / 2801 closed ( +4) / 3087 total (+11) Bugs: 870 open (+19) / 4867 closed (+14) / 5737 total (+33) RFE : 175 open ( +2) / 150 closed ( +0) / 325 total ( +2) New / Reopened Patches __ inspect.p

Sybase module 0.37pre1 released

2005-03-18 Thread Dave Cole
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: This release contains a number of small bugfixes and patches received from users. I have been unable to find the sourc

Re: create/access dynamic growth list

2005-03-18 Thread sam
Larry Bates wrote: sam wrote: Hi, I have a configuration file need to be processed (read/write) by python. Currently I the following method can only read and store data that python read a line from a configuraiton file: def _parse (self): # parse message m = self.FWShow_Command.match

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Raymond Hettinger
[Jeff Epler] > Maybe something for sets like 'appendlist' ('unionset'?) I do not follow. Can you provide a pure python equivalent? Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple XML-to-Python conversion

2005-03-18 Thread [EMAIL PROTECTED]
I've tried xmltramp and element tree, but these tools aren't what I had in mind. I've come to the realization that it's not the tools that are lacking. In fact, I'm a big fan of ElementTree now, but would only use it for large parsing tasks. Instead, I think the problem is either inherent in the

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Raymond Hettinger
[Roose] > I like this, it is short, low impact, and makes things more readable. I > tend to go with just the literal way of doing it instead of using get and > setdefault, which I find awkward. Thanks. Many people find setdefault() to be an oddball. > But alas I had a my short, low impact, use

Re: Simple XML-to-Python conversion

2005-03-18 Thread Swaroop C H
On 18 Mar 2005 20:24:56 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >From what I understand, this is how XML was standardized, in a sort of > hierarchical structure of infinite possibilities. The problem I'm > having with these structures is that I need to actively search through > each

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Brian van den Broek
Raymond Hettinger said unto the world upon 2005-03-18 20:24: I would like to get everyone's thoughts on two new dictionary methods: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty def appen

ElementTree Tidy HTML Tree Builder and comments

2005-03-18 Thread BjÃrn LindstrÃm
I'm considering using the ElementTree Tidy HTML Tree Builder for a web spidering program I'm developing. However, my program must be able to extract certain information from HTML comments. I'm basically creating my trees like this: TidyHTMLTreeBuilder.parse(urllib.urlopen(url)) What I want to k

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Bengt Richter
On Sat, 19 Mar 2005 03:14:07 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: [...] >Yes, but duck typing for any obj that supports "+" gets you a lot, ISTM at >this stage >of this BF ;-) Just in case, by "this BF," I meant to refer to my addval idea, with no offensive charaterization of anyone else

Re: survey of modules to be added to stdlib

2005-03-18 Thread Swaroop C H
On Sat, 19 Mar 2005 03:40:31 GMT, Ron <[EMAIL PROTECTED]> wrote: > I would prefer to have a install utility included that retrieves a > list of modules we can install, update, or uninstall, from the web in > a consistent easy way. It would really be nice if they listed what > modules they were dep

Re: wxPython vs. pyQt

2005-03-18 Thread Mike P.
"RM" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Of course, the licensing terms may still be too restrictive for those > that want to create comercial closed source applications and can't > afford the comercial license of Qt. That is why, for many, wxPython > will remain the pre

Re: wxPython vs. pyQt

2005-03-18 Thread Swaroop C H
On Sat, 19 Mar 2005 15:55:23 +1100, Mike P. <[EMAIL PROTECTED]> wrote: > Personally for ease of use Qt is the way to go. I'm really looking forward > to Qt 4 coming out, and then sometime later PyQt 4. Then I'll be able to > develop with my favourite APIs (Qt, OpenGL, and OpenSceneGraph) under a >

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Michele Simionato
+1 for inc instead of count. appendlist seems a bit too specific (I do not use dictionaries of lists that often). The problem with setdefault is the name, not the functionality. get_or_set would be a better name: we could use it as an alias for setdefault and then remove setdefault in Python 3000.

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > +1 for inc instead of count. I'd prefer incr or increment to inc. add is also ok. count isn't so great. Something like add_count or inc_count or add_num or whatever could be ok. -- http://mail.python.org/mailman/listinfo/python-list

Re: list of unique non-subset sets

2005-03-18 Thread Bengt Richter
On 18 Mar 2005 19:41:55 -0800, [EMAIL PROTECTED] wrote: >Once again my specs were incomplete. >By largest I mean exactly what you pointed out as in sum(map(len, >setlist)). > But that will not necessarily yield a single setlist taken from the source set list, so you still need a selection amongst

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Michael Spencer
Raymond Hettinger wrote: I would like to get everyone's thoughts on two new dictionary methods: +1 count ? appendlist The proposed names could possibly be improved (perhaps tally() is more active and clear than count()). IMO 'tally' is exactly the right method name One issue is with negative incre

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Raymond Hettinger
[Michele Simionato] > +1 for inc instead of count. Any takers for tally()? We should avoid abbreviations like inc() or incr() that different people tend to abbreviate differently (for example, that is why the new partial() function has its "keywords" argument spelled-out). The only other issue I

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Paul Rubin
"Raymond Hettinger" <[EMAIL PROTECTED]> writes: > [Michele Simionato] > > +1 for inc instead of count. > > Any takers for tally()? I'd say "tally" has some connotation of a counter that can never go negative. I don't know if that behavior is desirable. Someone suggested deleting the key if the

Re: Simple account program

2005-03-18 Thread Chris Rebert (cybercobra)
Since everyone's improving the program, I thought I'd just tweak Dennis Lee Bieber's code a little. Here's the result. Good luck Ignorati! import time class Transaction(object): def __init__(self, payee, amount, date=None): # amount is the amt withdrawn/deposited self.payee =

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Reinhold Birkenfeld
Raymond Hettinger wrote: > [Michele Simionato] >> +1 for inc instead of count. > > Any takers for tally()? Well, as a non-native speaker, I had to look up this one in my dictionary. That said, it may be bad luck on my side, but it may be that this word is relatively uncommon and there are many ot

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Roose
> +1 for inc instead of count. > appendlist seems a bit too specific (I do not use dictionaries of lists > that often). No way, I use that all the time. I use that more than count, I would say. Roose -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Raymond Hettinger
> > d.count(key, qty) > > d.appendlist(key, *values) [Bengt Richter] > How about an efficient duck-typing value-incrementer to replace both? There is some Zen of Python that argues against this interesting idea. Also, I'm concerned that by folding appendlist() into valadd() we would lose an imp

<    1   2