Re: a hobbyist's dilemma

2006-03-29 Thread Jim Sizelove
or mailing list (http://mail.python.org/mailman/listinfo/tutor) and learn from others and learn by helping others. Enjoy your python adventures, Jim Sizelove -- http://mail.python.org/mailman/listinfo/python-list

Re: What does "::" mean?

2005-07-21 Thread Jim Sizelove
t reversed(live)? Or if you want a list instead of an >> iterator, list(reversed(live))? > > > That's fine if you want to iterate over it. Often, especially with > strings, you just want an object of the same type back again. > Then you could use: ''.jo

Re: Merging overlapping spans/ranges

2005-05-10 Thread Jim Sizelove
start, end = s,e ... continue ... if s <= end: ... if end < e: ... end = e ... continue ... yield start, end ... start,end = s,e ... if start is not None: ... yield start, end ...

Re: key binding with mac

2005-04-26 Thread Jim Sizelove
support. You can get it through http://pythonmac.org/packages or via fink. You will find the Pythonmac-SIG mailing list very helpful for questions about Python on the Macintosh. You can learn more at: http://www.python.org/sigs/pythonmac-sig/ HTH, Jim Sizelove -- http://mail.python.org/mailman

Re: recording data between [ and ]

2005-04-21 Thread Jim Sizelove
: >>> def between2(data, start, end): ... pattern = re.escape(start) + ' # start tag \n' +\ ... r'([^' + re.escape(end) + r']*)' + " # anything except end tag \n" +\ ... re.escape(end) + ' # end tag \n' ... return re.findall(pattern, data, re.VERBOSE) ... >>> print between2(foo, '[', ']') ['lsass.exe', 'System', 'firefox.exe'] >>> print between2(foo, '<', '>') ['stuff', 'more', 'qqq'] Regards, Jim Sizelove -- http://mail.python.org/mailman/listinfo/python-list

Re: Python / Win32 extensions compatibility with Windows XP

2005-04-12 Thread Jim Sizelove
Matthew wrote: Hi: I recently installed Python 2.4 and the Win 32 extensions on Windows XP. I had some problems with the COM makepy utility for the Excel COM libraries. I reported this problem to the sourceforge bug tracker. My question is , is python 2.3 and the win32 extensions more stable than

Re: Running doctests with unittest

2005-03-09 Thread Jim Sizelove
by doing the following: if __name__ == '__main__': import doctest, unittest suite = doctest.DocTestSuite() testRunner = unittest.TextTestRunner() testRunner.run(suite) HTH, Jim Sizelove -- http://mail.python.org/mailman/listinfo/python-list

Re: Python COM Makepy Excel 9.0 error

2005-02-10 Thread Jim Sizelove
ilar problems when moving some code from Python 2.3 to Python 2.4. Seems that running "makepy -d ..." works. See Mark Hammond's explanation at: http://mail.python.org/pipermail/python-win32/2004-December/002743.html [python-win32] WMI scripting makepy error with ActivePython

Re: Configuring Python for Tk on Mac

2005-01-21 Thread Jim Sizelove
info easily. Yours, Martyn You probably need to install Tcl/Tk Aqua: http://tcltkaqua.sourceforge.net After downloading and installing on my Mac running OS X v 10.2, I am able to open IDLE and other Tk apps. HTH, Jim Sizelove -- http://mail.python.org/mailman/listinfo/python-list

Re: When was extended call syntax introduced?

2004-12-21 Thread Jim Sizelove
Edward K. Ream wrote: Various documentation pages, e.g. http://www.python.org/doc/2.3.3/lib/non-essential-built-in-funcs.html state that the apply function has been deprecated since 2.3. Can anyone tell me when extended call syntax was actually introduced? Neither googling nor brief checks of the

Re: Easy "here documents" ??

2004-12-21 Thread Jim Sizelove
Doug Holton wrote: Bengt Richter wrote: variable1 = 1 variable2 = 2 s = """ v = ${variable1} v2's value is: ${variable2} """ However, Python 3.0 is likely years away. If you want to know how to run code like this today, consult Fredrik Lundh. Or replace ${...} with equally simple %(...)s in

Re: PyCrust: What am I suppose to do?

2004-12-18 Thread Jim Sizelove
It's me wrote: I am trying out PyCrust and at a lost what to do next. With the previous IDE I tried, the IDE pops up the console and the editor. From the editor, I can set up breakpoints and debug and so forth. Yes, I can even run the script. With PyCrust, the nice looking 3-pane window pops up

Re: Dynamically passing variables to unittest

2004-12-15 Thread Jim Sizelove
Tom Haddon wrote: Hi Peter, Yeah, you're right, the term "ConnectString" is a little confusing. Perhaps I should change that. Here's a valid call to DB: conn=DB.DB('pg','test','localhost',5432,'test','test') In the context of this unittest, a valid syntax would be (except that this unittest would

Re: Help with use of code.InteractiveInterpreter for multiline code

2004-12-03 Thread Jim Sizelove
[EMAIL PROTECTED] wrote: I'm trying to embed a Python interpreter in a GUI I'm developing, and I'm having trouble understanding the proper use of code.InteractiveInterpreter. [examples of calling the interpreter instance] What's the proper way to call the interpreter instance for a multiline exampl