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 os | |
import argparse | |
def tobits(s): | |
result = [] | |
for c in s: | |
bits = bin(ord(c))[2:] | |
bits = '00000000'[len(bits):] + bits | |
result.extend([int(b) for b in bits]) | |
return result |
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
# Generates a random string of length k to std out | |
import argparse | |
import string | |
import random | |
def id_generator(size, chars=string.ascii_uppercase \ | |
+ string.digits \ | |
+ string.ascii_lowercase): | |
return ''.join(random.choice(chars) for _ in range(size)) |
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 argparse | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description='Easy way to produce plots of\ | |
3D vector fields in python.') | |
parser.add_argument('task', | |
help='task name', | |
type=str) | |
parser.add_argument("-f", '--fileNameTag', | |
help='Appends it to the end of a filename so it can be unique when you plot it', |
NewerOlder