title: How to read a FASTA file and insert the sequence in another function calling a class?
body: <p>I have an assignment where I have to write a python class to represent and manipulate biological sequences. I have almost finished the class, however I need to import sequences from FASTA files input the class, so that it can run them. 
  In order to run the class in the command line, I was required to create a run_me.py file, which when executed in the command line, should ask for the FASTA file and then run the class.</p>
  
  <p>This is the class constructor:</p>
  
  <pre><code>class Bioseq:
      """Biological sequence class"""
      def __init__(self, seq):
          self.seq = seq
  </code></pre>
  
  <p>And this is how far I've gotten with the run_me.py file:</p>
  
  <pre><code>def read_fasta():
          with open(file_name, "r") as fh:
              line = fh.readline()
              header = ""
              seq = ""
              while line:
                  line = line.rstrip('\n')
                  if "&gt;" in line:
                      header = line
                  else:
                      seq = seq + line
                  line = fh.readline()
          return seq
          print(seq)
  
  
  from TPC2_MR2 import Bioseq
  file_name = input("Please enter sequence file name:")
  Bioseq = Bioseq(read_fasta())
  Bioseq.main()
  </code></pre>
  
  <p>TPC2_MR2 is the name of the class module. 
  Now the problem is that when I execute the run_me.py file, I am asked to provide the name of the FASTA file but after that, the sequence is not imported into the class. What should I do?</p>
  
  <p>Please note that I cannot use external Pyhton modules, such as Biopython.</p>