This file contains 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 imageio | |
import numpy as np | |
import pyastar | |
def maze_to_grid(img): | |
grid = img.astype(np.float32) | |
grid[grid == 0] = np.inf | |
grid[grid == 255] = 1 |
This file contains 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 main(): | |
inpath = 'messages.txt' | |
outpath = 'parsed.txt' | |
name = 'First Last' | |
marker = '%s:' % name | |
with open(inpath, 'r') as fin, open(outpath, 'w') as fout: | |
for line in fin.readlines(): | |
if marker in line: | |
message = line.split(marker)[1].strip() |