这里的代码是我首先读取文件配置,然后我需要将目录传递到称为ednotes的方法中_提取器。获取注释()
from preprocessing import ednotes_extractor
csf_config_txt = open("..\CFS_Config.txt", "r")
file_list = []
root_dir = ""
edn_txt = ""
pcr_txt = ""
for line in csf_config_txt:
file_list.append(line)
if "Folder Path = " in file_list[0]:
root_dir = str(file_list[0])
root_dir = root_dir.replace("Folder Path = ", "")
root_dir = root_dir.replace("\n", "")
if "ED Notes = " in file_list[1]:
root_dir = str(file_list[1])
root_dir = root_dir.replace("ED Notes = ", "")
root_dir = root_dir.replace("\n", "")
if "Patient Care Record = " in file_list[2]:
root_dir = str(file_list[2])
root_dir = root_dir.replace("Patient Care Record = ", "")
root_dir = root_dir.replace("\n", "")
print(file_list[2])
def convert_txt(choices):
if(choices == 1):
#I would like to pass a directory in this method called theednotes_extractor
ednotes_extractor.get_ednotes(str2=file_list[1])
elif(choices==2):
print("Hi")
也许这会有帮助
只需添加两个数组而不使用[]
对你来说
以上就足够了。你知道吗
试试这个:
列表理解就可以了。它将打开列表列表并将其放入新列表中。你知道吗
相关问题 更多 >
编程相关推荐