Python script isn't producing text in data file

Chris Angelico rosuav at gmail.com
Wed Dec 10 23:35:38 EST 2014


On Thu, Dec 11, 2014 at 3:23 PM, Docfxit <docfxit at gmail.com> wrote:
> Thank you all for the encouragement to make it smaller.
> I don't know enough about Python to figure out how to isolate where the problem is happening.
>
> Maybe it would be best If I could get some help in getting a debugger working so I can try to work through the script one line at a time.  I have started to install a debugger but I can't get it working.
> I'm working in Win7 Pro.  I'm trying to get Winpdb working.
> I have an error when I run the debugger.  It says winpdb is missing.

A debugger is a nice tool when you can get it working, but at the
moment, it sounds like you're heading down the path of yak shaving. I
would recommend taking a much MUCH simpler approach: divide and
conquer. Strip out a bunch of code, try the program again. If it still
has the problem, you know the problem wasn't in the code you just
removed. If it doesn't, you know the problem _was_ in that code. (If
you just created a brand new problem, back out the change and try
something different.)

By this method, you can usually cut a problem down to size. Sometimes
you'll find that the problem disappears when any of several pieces of
code is removed, which means it's some sort of interaction between
them; in that case, keep both, but see how much other code you can
remove. As long as the issue you're seeing is at least mostly
deterministic, this sort of technique will help you to pin it down,
even if you aren't too familiar with the language.

ChrisA



More information about the Python-list mailing list