def create_and_run_prefix(prefix, path): file_name = project_path(path) with open(file_name+'.dna', 'w') as fout: fout.write(prefix) os.system(project_path('scripts\\exec_build.bat')+' '+file_name)
# higher level stuff related to contents of DNA import os import re from collections import namedtuple from helpers import project_path from dna_basics import * endo_file_name = project_path('data/endo.dna') _endo = None def endo(): global _endo if _endo is None: _endo = open(endo_file_name).read() return _endo def show_pattern_and_template(dna): from executor import Executor e = Executor(dna) e.explicit_rna_items = True pattern = e.pattern() pattern.append('EoP') template = e.template() template.append('EoT') e.item_starts.append(e.parser.index)