How to run a function in SPE on Python 2.5

bill lawhorn wlawpa at gmail.com
Wed Jun 22 22:19:58 EDT 2011


I have a program: decrypt2.py which contains this function:


def scramble2Decrypt(cipherText):
    halfLength = len(cipherText) // 2
    oddChars = cipherText[:halfLength]
    evenChars = cipherText[halfLength:]
    plainText = ""

    for i in range(halfLength):
        plainText = plainText + evenChars[i]
        plainText = plainText + oddChars[i]

    if len(oddChars) < len(evenChars):
        plainText = plainText + evenChars[-1]

    return plainText

When I load this program in SPE and click on debug with winpdb i'm not
sure what to do next. In Idle I would just
type in scramble2Decrypt("aaaabbbb"), hit enter an get a result.

I have tried to call this function from the Command box in winpdb and
also at the >> in SPE with no luck.

I want to be able to step through the program one line at a time.

Any help would be appreciated for this nube.



More information about the Python-list mailing list