Re: how to stop a function execution like...

2009-06-16 Thread mzdude
On Jun 16, 7:30 am, Gaudha wrote: > Is there any built-in function to stop execution of a function similar > to stop the program execution by sys.exit? > In the example below, I want to skip statement 2... if the 'if' > condition is satisfied. > Don't advice me to put statement 2 in 'else' block.

Re: find sublist inside list

2009-05-05 Thread mzdude
On May 4, 4:54 pm, "Gabriel Genellina" wrote: > En Mon, 04 May 2009 15:12:41 -0300, mzdude escribió: > > > substring isn't limited to 0..255 > >>>> substring = "\0x%d\0x%d" % (257,257) > >>>> 'acaccgac'.replace("

Re: find sublist inside list

2009-05-04 Thread mzdude
On May 4, 9:01 am, Matthias Gallé wrote: > bearophileh...@lycos.com wrote: > > John O'Hagan: > >> li=['a', 'c', 'a', 'c', 'c', 'g', 'a', 'c'] > >> for i  in range(len(li)): > >>     if li[i:i + 2] == ['a', 'c']: > >>         li[i:i + 2] = ['6'] > > > Oh well, I have done a mistake, it seems. > > A

Re: Request Help Debugging Program

2008-07-23 Thread mzdude
On Jul 23, 6:30 pm, Samir <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > > def findSumOfDivisor(n): >     return sum(divisor)                # fine using function sum() > >         sum = findSumOfDivisor(i)      # then find the sum of its divisors oops redefine what sum is. >>> x = [1,2] >>> sum

Re: Retrieving BSTR * from a DLL

2008-07-10 Thread mzdude
On Jul 10, 6:15 am, Andrew MacIntyre <[EMAIL PROTECTED]> wrote: > This likely indicates that the DLL is using the C calling convention > and not the stdcall calling convention.  Use CDLL rather than WinDLL > to load the DLL. using cdll got me over the calling hurdle. However, I'm not seeing the r

Retrieving BSTR * from a DLL

2008-07-09 Thread mzdude
I need to interface with a windows DLL that has the following signature extern "C" void Foo( BSTR in, BSTR *out ) Code so far >>> from ctypes import * >>> import comtypes >>> LPBSTR = POINTER(comtypes.BSTR) >>> >>> hdl = windll.MyDll.Foo >>> hdl.rettype = None >>> hdl.argtypes = [comtypes.BSTR,

Re: Appropriate way to quit Tkinter

2006-10-13 Thread mzdude
Fredrik Lundh wrote: > mzdude wrote: > > >> works for me. are you perhaps running this under some kind of IDE that > >> keeps the process running even after the program has terminated? > >> > > It works the same way if I run from IDLE or from the DOS

Re: Appropriate way to quit Tkinter

2006-10-12 Thread mzdude
Fredrik Lundh wrote: [snip] > works for me. are you perhaps running this under some kind of IDE that > keeps the process running even after the program has terminated? > It works the same way if I run from IDLE or from the DOS command prompt. -- http://mail.python.org/mailman/listinfo/python-li

Appropriate way to quit Tkinter

2006-10-12 Thread mzdude
I've just started playing with Python. Installed 2.5 on Windows XP system. I'm working through some of the examples in Programming Python 3ed by Mark Lutz. Given the following example when the Quit All button action is assigned to root.quit the windows aren't dismissed or destroyed. The application