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
#!/usr/bin/env python3 | |
''' Use a PhotoImage to plot single pixels in a Tkinter Label | |
For some strange reason, it starts out fast but slows down... | |
Written by PM 2Ring 2017.05.13 | |
''' | |
import tkinter as tk |
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
#!/usr/bin/env python3 | |
''' Use a PhotoImage to plot single pixels in a Tkinter Label | |
Written by PM 2Ring 2017.05.13 | |
''' | |
import tkinter as tk | |
from time import perf_counter | |
import sys |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python3 | |
''' Simple orbit sim | |
Uses a PhotoImage to plot single pixels in a Tkinter Canvas | |
Built from tk_photoimage_pixels3.py | |
Written by PM 2Ring 2017.05.20 | |
''' |
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
#!/usr/bin/env python | |
""" Compare the speed of sum(xrange()) to sum(range()) | |
Written by PM 2Ring 2017.06.05 | |
""" | |
from timeit import Timer | |
cmds = { |
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
n = '12345678901234567890' | |
total = units = a = sum(map(int, n)) | |
for k, d in enumerate(n[:-1], 1): | |
units -= int(d) | |
a = (a - int(n[-k:])) * 10 + units | |
total += a | |
print(total) |
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
#!/usr/bin/env python3 | |
''' Compare the speeds of zip and various Numpy functions | |
for stacking to 1D Numpy arrays into a 2D array | |
See https://stackoverflow.com/q/44409084/4014959 | |
Written by PM 2Ring 2017.06.08 | |
''' |
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
#!/usr/bin/env python3 | |
''' Compare the speeds of random.shuffle | |
with sorted using a random key function | |
Written by PM 2Ring 2017.06.09 | |
Python 2 / 3 compatible | |
''' |
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
x = 1968, y = 926, rule = B3/S23 | |
1046b2o$1046bo$1038bo5bobo$1038bobo3b2o$1021bo17bobo$1021b2o16bo2bo$ | |
1012b2o2b2o4b2o15bobo$1012b2o2b2o4b3o13bobo5b2o12b2o$1016b2o4b2o7bobo | |
4bo7bo13b2o$1021b2o9b2o10bobo13b2o$1021bo10bo11b2o14bo$1059bobo$1059bo | |
bo$1039b2o19bo$1038bobo$1040bo$1057b2o3b2o$1057bobobobo57b2o$1058b5o | |
58bo$1028bo7b2o21b3o51bo5bobo$1028b2o6b2o22bo52bobo3b2o$1027bobo66bo | |
17bobo$1096b2o16bo2bo$1087b2o2b2o4b2o15bobo$1087b2o2b2o4b3o13bobo5b2o | |
12b2o$1091b2o4b2o7bobo4bo7bo13b2o$1096b2o9b2o10bobo13b2o$1020b2o35bobo | |
36bo10bo11b2o14bo$1021b2o34b2o75bobo$1020bo37bo75bobo$1114b2o19bo$ | |
1047b2o64bobo$1047b2o12b3o51bo$1060bo3bo67b2o3b2o$1013bo37bo7bo5bo66bo |
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
#!/usr/bin/env python3 | |
''' Show HTML file structure | |
Written by PM 2Ring 2017.06.19 | |
''' | |
import sys | |
from html.parser import HTMLParser |