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 win32clipboard | |
| def set_clipboard(text): | |
| win32clipboard.OpenClipboard() | |
| win32clipboard.EmptyClipboard() | |
| win32clipboard.SetClipboardText(text, win32clipboard.CF_UNICODETEXT) | |
| win32clipboard.CloseClipboard() |
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
| def divide(a): | |
| return a[:len(a)//2], a[len(a)//2:] | |
| def merge(a, b): | |
| result = [] | |
| while(True): | |
| if len(a) == 0: | |
| result += b |
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
| # simple hexdump function | |
| # it's very similar to hexdump from Black Hat Python, but it runs on Python 3 | |
| def hexdump(src, length=16): | |
| result = [] | |
| digits = 2 | |
| for i in range(0, len(src), length): | |
| s = src[i:i+length] | |
| hexa = ' '.join(["%0*X" % (digits, ord(x)) for x in s]) |
NewerOlder