I have a file called path_text.txt
its contents are the 2 strings separated by newline:
/gp/oi/eu/gatk/inputs/NA12878_24RG_med.hg38.bam
/gp/oi/eu/gatk/inputs/NA12878_24RG_small.hg38.bam
I would like to have a json array object like this:
["/gp/oi/eu/gatk/inputs/NA12878_24RG_med.hg38.bam","/gp/oi/eu/gatk/inputs/NA12878_24RG_small.hg38.bam"]
I have tried something like this:
with open('path_text.txt','w',encoding='utf-8') as myfile:
myfile.write(','.join('\n'))
But it does not work