#!/usr/bin/env python > 2.4?

rh0dium steven.klass at gmail.com
Tue Mar 20 17:22:25 CET 2007

Hi Folks,

OK I love the logging module.  I use it everywhere.  I was happily
putting at the top of each of my scripts

#!/usr/bin/env python2.4

import logging


# Set's up a basic logger
logging.basicConfig(level=LOGLEVEL, format="%(asctime)s %(name)s %
(levelname)-8s %(message)s",
                    datefmt='%d %b %Y %H:%M:%S', stream=sys.stderr)

    module= os.path.basename(traceback.extract_stack(limit=2)[1]
    module = os.path.basename(traceback.extract_stack(limit=2)[0]

def main(loglevel=False):
    """ """
    # Setup Logging
    log = logging.getLogger(module+sys._getframe().f_code.co_name )
    if loglevel is not False: log.setLevel(loglevel)

    log.debug("I LOVE LOGGING")

if __name__ == '__main__':


But now you guys continued to make this cool language and 2.5 came
out. Great now how do I put /usr/bin/env python>2.4?

Or can you suggest a better way to skin this cat?

Thanks again!!

More information about the Python-list mailing list