# coding: utf-8 import os, sys sys.path.append(os.getcwd()) from modules import extract_British_from_json import re if __name__ == '__main__': lines = extract_British_from_json().split("\n") for line in lines: file_line = re.search('(File|ファイル):(.*?)\|.*', line) if file_line is not None: print(file_line.group(2))
# coding: utf-8 import os, sys sys.path.append(os.getcwd()) from modules import extract_British_from_json import re if __name__ == '__main__': map = {} lines = re.split('\n\||\n\}', extract_British_from_json()) for line in lines: temp_line = re.search('(.*) = (.*)', line, re.S) if temp_line is not None: map[temp_line.group(1)] = temp_line.group(2) for key, value in map.items(): print(key, value)
# coding: utf-8 import os, sys sys.path.append(os.getcwd()) from modules import extract_British_from_json import json if __name__ == '__main__': print(extract_British_from_json())