| 173 | os.system('cls' if os.name=='nt' else 'clear') |
| 174 | |
| 175 | def cprint(self, message, **kwargs): |
| 176 | strip_colors = kwargs.get("strip_colors", False) |
| 177 | if os.name == "nt": |
| 178 | strip_colors = True |
| 179 | reset = u"\u001b[0m" |
| 180 | # Requires sys import |
| 181 | for c in self.colors: |
| 182 | if strip_colors: |
| 183 | message = message.replace(c["find"], "") |
| 184 | else: |
| 185 | message = message.replace(c["find"], c["replace"]) |
| 186 | if strip_colors: |
| 187 | return message |
| 188 | sys.stdout.write(message) |
| 189 | print(reset) |
| 190 | |
| 191 | # Needs work to resize the string if color chars exist |
| 192 | '''# Header drawing method |