from instruction_table import untabulate_instructions_sh4 from instruction_table import unparse_instruction_code from instruction_file_name import instruction_file_name for ins in untabulate_instructions_sh4(): code = unparse_instruction_code(ins) file_name = instruction_file_name(ins) path = os.path.join("sh4", file_name) assert not os.path.exists(path) with open(path, 'w') as f: f.write(code + '\n')