Skip to content

Instantly share code, notes, and snippets.

View anomalyjane's full-sized avatar

Emily Robinson anomalyjane

View GitHub Profile
@anomalyjane
anomalyjane / Read_configs.py
Last active August 15, 2016 17:00
Reads in RC folder and outputs existing unit-level config files with task types
#!/usr/bin/env python
#Reads in RC folder and outputs existing unit-level config files with task types
import re
import os
import sys
import glob
dir_input = 'path to your alp-workspace' + '/alp-workspace/assets/content/rc'
@anomalyjane
anomalyjane / Vocab_quiz.py
Last active August 21, 2016 00:35
A vocabulary quiz written for Python 2
#!/usr/bin/env python
# This program is a fill-in-the blank quiz, prompting for user input at each blank.
import os
import json
with open('questions_and_answers.json', 'r') as f:
content = f.read()
content_dict = json.loads(content)
@anomalyjane
anomalyjane / Bundle_questions.py
Last active August 3, 2016 00:23
I wrote this program to automate a work task that required a lot of manual grunt work. I needed to read in a text document containing questions and answer choices in a predictable format, and output text wrapped in a CDATA tag and ready to insert into a consecutive column of cells in a CSV.
#!/usr/bin/env python
import re
def edit_questions(infile):
questions = []
choices = []
fin = open(infile, "r")
print "Answers for CSV\n"
for line in fin:
@anomalyjane
anomalyjane / delete_assets.py
Last active April 18, 2016 14:51
This basic crawler takes a list of file names and the name of a directory, finds the files if they exist, and allows one-click batch deletion. Code by Alan Gauld on mail.python.org/mailman/listinfo/tutor Learn Python Thread
#!/usr/bin/env python
import os
import sys
import glob
#Names the directory to search (search will include all subdirectories too)
dir_input = 'directory'
#Names the file that you want to delete