Matthew Wilson wrote:
I'm using a homemade script to verify some code samples in my
documentation.  Here it is:

    #! /usr/bin/env python2.6

    # vim: set expandtab ts=4 sw=4 filetype=python:

    import doctest, os, sys

    def main(s):
        "Run doctest.testfile(s, None)"

        return doctest.testfile(s, None)

    if __name__ == "__main__":
        for x in sys.argv[1:]:
            print "testing code excerpts in %s..." % x
            print main(x)


The script checks all the files listed as arguments.  This is OK, but is
there anything better?


maybe glob.glob('*.py')?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to