分隔的多行我想過濾以RUN開頭並由\分隔的行。如何連接由
RUN install-repository \
"--url http://toolshed.g2.bx.psu.edu/ -o iuc --name gatk2 --panel-section-name GATK2" \
"--url http://toolshed.g2.bx.psu.edu/ -o devteam --name suite_samtools_0_1_19 --panel-section-name SAMTools" \
"--url http://toolshed.g2.bx.psu.edu/ -o devteam --name freebayes --panel-section-name Freebayes"
RUN ...
此刻我
RUN install-repository \
RUN install-repository \
...
與下面的代碼:
import urllib2
def run():
file_url = "https://raw.githubusercontent.com/bgruening/docker-recipes/master/galaxy-exom-seq/Dockerfile"
data = urllib2.urlopen(file_url)
for line in data:
if line.startswith("RUN"):
print line.rstrip()
if __name__ == '__main__':
run()
什麼是做到這一點的最好方法是什麼?
謝謝。我改變了print(line.rstrip('\ n'))和re2 =「--url」。 – user977828