Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 1.15 KB

README.md

File metadata and controls

34 lines (30 loc) · 1.15 KB

Some basic function for Printing and Timing

two function for colorful printing, a class for timing.

Requirements

Function list

  • 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' more
       print2("i=%d" % 10, textColor='green')
       print2("i=%d" % 10, [1, 2, 3], textColor='red')
       print2("i=%d" % 10, [1, 2, 3])

Class list

  • class Timer
       T=Timer()
       T.begin()
       # some function
       T.end("Func")

Author

Chen Yu / @Chen Yu