title: How to call external input and output file names to run Python Programs at Linux Command Prompt
body: <p>In my Python Program, I have lines to open an input file:</p>
  
  <pre><code>f = open('/home/han/fasta.txt',"r")
  </code></pre>
  
  <p>and to write an output file:</p>
  
  <pre><code>with open("output.txt", "w") as text_file:
      text_file.write ("{:&lt;16}{:&lt;16}{:&lt;16}{:&lt;16}{:&lt;16}".format('','A','C','G','T')+'\n')
  </code></pre>
  
  <p>However, every time I want to run the Python program in Linux Command Prompt with different, I have to change the input and output file names in codes.
  I would like to know how to achieve running the program at Linux command prompt exactly as below: (in which I need to enter "-i" and "-o" for input and output file names respectively)</p>
  
  <pre><code>$ python codon.py -i fasta.txt -o output.txt
  </code></pre>
  
  <p>I have tried for the input file name</p>
  
  <pre><code>from sys import argv
  script, filename = argv
  f = open(filename,"r")
  </code></pre>
  
  <p>but I felt it doesn't necessarily need the "-i" in command prompt.</p>
  
  <p>Sorry if the question is incredibly obvious...I am new to Python</p>