makepy crashing

2005-01-18 Thread markscottwright
Has anyone sucessfully run makepy and Microsoft Word Object Library (9.0)? Mine crashes under XP Pro and Python 2.4. It only seems to be word that has the problem, though. I get a dialog that says that pythonwin.exe has crashed: AppName: pythonwin.exe AppVer: 0.0.0.0 ModName: ntdll.dll

iterative lambda construction

2005-02-21 Thread markscottwright
Just for the hell of it, I've been going through the old Scheme-based textbook "Structure and Interpretation of Computer Programs" and seeing what I can and can't do with python. I'm trying to create a function that returns the function (not the results of the function, but a function object) that

How to I restart an interactive session?

2005-03-18 Thread markscottwright
I'm trying to cobble together an IDLE equivalent using pyshell and VIM (My idea is just to pipe exec file commands from VIM to pyshell via a socket or something). The one feature that IDLE has that I would really like but can't seem to duplicate is the "Restart Shell" command. Delving through the

Re: How to I restart an interactive session?

2005-03-18 Thread markscottwright
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__['os'] --- point B I guess my question boils down to,

Re: Abelson and Python

2006-11-22 Thread markscottwright
[EMAIL PROTECTED] wrote: > While studying the SICP video lectures I have to twist my mind some to > completely understand the lessons. I implement the programs shown there > in both Python and Scheme, and I find the Python implementations > simpler to write (but it's not a fair comparison because

Re: Abelson and Python

2006-11-23 Thread markscottwright
Fredrik Lundh wrote: > markscottwright wrote: > > > If it were that easy, the PyPy guys would be done by now. > > if the PyPy guys had focused on writing a Python interpreter in Python, > they'd been done by now. > > Isn't that the point of PyPy? It'

Is there a standard binary search with overridable comparisons?

2008-06-17 Thread markscottwright
I've got an ordered list of MyClasses that I want to be able to do binary searches on, but against a tuple. MyClass has valid __lt__(self, rhs) and __eq__(self, rhs) member functions that work when rhs is a tuple. This works: l = [MyClass(..), MyClass(..), ...] l.find((a,b)) But this doesn't: bi

How do I convert an iterator over bytes into a str?

2009-08-18 Thread markscottwright
This does what I expected: In [6]: list(iter([1,2,3,4,5])) Out[6]: [1, 2, 3, 4, 5] But this appears to be doing a __repr__ rather than making me a nice string: In [7]: str(iter("four score and seven years ago")) Out[7]: '' What's the correct way to turn an iterator over bytes into a

Re: How do I convert an iterator over bytes into a str?

2009-08-19 Thread markscottwright
On Aug 18, 6:52 pm, "Jan Kaliszewski" wrote: > 19-08-2009 o 00:24:20 markscottwright wrote: > > > What's the correct way to turn an iterator over bytes into a string? > > This works, but, ewww: > >     In [8]: "".join(iter("four score and se