Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wouldn't this work? I can't test it at the moment.

    print_function = lambda c:  getattr(colored, c)
    printred = colored.print_function("red")
    printred("This prints in red")


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: