two function for colorful printing, a class for timing.
- printf(print_text, *args, textColor='white', end=' ')
The usage of this function is similer to 'printf' in C/C++ but you could set your own text color.printf("i=%d\n", 10, textColor='green') printf("i=%d\n" % 10, textColor='red') printf("i=%d\n", 10) printf("i=%d\n" % 10)
- print2(print_text, *args, textColor='white', end='\n')
The usage of this function is similer to 'print' in Python but with a key parameter 'textColor' moreprint2("i=%d" % 10, textColor='green') print2("i=%d" % 10, [1, 2, 3], textColor='red') print2("i=%d" % 10, [1, 2, 3])
- class Timer
T=Timer() T.begin() # some function T.end("Func")
Chen Yu / @Chen Yu