I have been trying to run a script on my terminal and unfortunately when i do i
ID: 3906268 • Letter: I
Question
I have been trying to run a script on my terminal and unfortunately when i do i do not understand the resopnse the terminal gives. I've provided the script and response below; (">> " is my PS1)
>> ./metaphlan2.py --input_type fastq
BowTie2 output file detected: stdin_map.bowtie2out.txt
Please use it as input or remove it if you want to re-perform the BowTie2 run.
Exiting..
please explain what it is requesting me to do, and if you are so kind, to provide a script that might point me in in the right direction, thank you!
Explanation / Answer
Solution: - First of all in a python terminal. The script can't be run like a bash terminal.
There are different method or python syntax is there to run a python script within python prompt.
>> ./metaphlan2.py will not perform here.
Instead you want to run your phython script
>>>execfile('metaphlan2.py') for python 2.0 and above.
OR
>>>exec((open("metaphlan2.py").read()) for python3 and above.
You can even use another method,
>>>import os
>>>os.system('./metaphlan2.py')
This will also work correctly.
>>>import subprocess
>>> subprocess.check_output(['./metaphlan2.py'], shell=True)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.