Created
July 18, 2012 10:31
-
-
Save herczy/3135453 to your computer and use it in GitHub Desktop.
Creepy gtk message dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygtk | |
| pygtk.require('2.0') | |
| import gtk | |
| import random | |
| full = '''To invoke the hive-mind representing chaos. | |
| Invoking the feeling of chaos. | |
| With out order. | |
| The Nezperdian hive-mind of chaos. Zalgo.for | |
| He who Waits Behind The Wall. | |
| ZALGO!''' | |
| def make_zalgo(text, c=100, p=10): | |
| res = [] | |
| for char in text: | |
| x = [char] | |
| for i in range(c): | |
| if random.randint(0, p) == 0: | |
| x.append(unichr(random.randint(0x300, 0x36F))) | |
| res.append((''.join(x)).decode('utf-8')) | |
| return ''.join(res) | |
| d = gtk.MessageDialog(message_format=make_zalgo(full), type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_OK) | |
| d.set_title(make_zalgo('Zalgo. He comes', p=100)) | |
| d.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment