agf1997
agf1997

Reputation: 2898

How to debug a Gooey GUI python program

I'm using Gooey to convert a simple set of argparse arguments in GUI elements. My IDE is pycharm. What I can't figure out is now to debug the program when the GUI is being called.

Below is a simple program that uses Gooey.

import argparse
from gooey import Gooey, GooeyParser

def get_args():
    parser = GooeyParser(description='Gooey Test',
                         formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument('a')
    parser.add_argument('b')

    results = parser.parse_args()

    return results


def addnumbers(a,b):
    c = a + b
    return c

@Gooey(advanced=True)
def main():
    results = get_args()
    a = float(results.a)
    b = float(results.b)
    c = addnumbers(a, b)

    return c


if __name__ == "__main__":
   c = main()
   print(c)

For example, if I place a breakpoint on a line 17 of the program (c = a + b) I would expect the program to stop there and allow me to inspect the values of variables that have been executed to that point. However, the program continues to run to completion.

Any thought would be greatly appreciated.

Upvotes: 0

Views: 1088

Answers (1)

agf1997
agf1997

Reputation: 2898

Turns out debugging doesn't work when running Gooey.

https://github.com/chriskiehl/Gooey/issues/144

The author suggests turning off the decorator while debugging.

Upvotes: 2

Related Questions