| 6 | print(f"{color_code}{text}"+Color.END) |
| 7 | |
| 8 | def generate_banner(): |
| 9 | name=""" |
| 10 | |
| 11 | |
| 12 | 公众号: 一位不愿透露姓名的热心网友 |
| 13 | Github:https://github.com/JaveleyQAQ |
| 14 | """ |
| 15 | selected_fonts = ['standard', 'big', 'slant', 'small', 'shadow'] |
| 16 | selected_font = random.choice(selected_fonts) |
| 17 | font = pyfiglet.Figlet(font=selected_font) |
| 18 | ascii_banner = font.renderText("WX DevTools") |
| 19 | color_codes = [Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW, Color.CYAN, Color.PURPLE] |
| 20 | selected_color = random.choice(color_codes) |
| 21 | ascii_banner_with_author = ascii_banner.rstrip('\r\n') + f'\n\n\t'+name+f'\n' |
| 22 | colored_print(ascii_banner_with_author, selected_color) |