My function run_deinterleave() is meant to copy code from the file deinterleave.sh then replace the placeholder (sra_data) with a file name which has been input by the user and then run it on the command line.
def  run_deinterleave():
   codes = open('Project/CODE/deinterleave.sh')     
   codex = codes.read()
   print(inp_address)
   codex = codex.replace('sra_data', inp_address)
   #is opening this twice creating another pipeline?
   stream = os.popen(codex)
   codes.close()
   
   self.txtarea.insert(END,codex)    
#stuff
However, I keep getting this error:
/bin/sh: 5: Syntax error: "(" unexpected
The code in deinterleave.sh works fine and produces two individual files given an interleaved paired end sra_file (an output file from genetic sequencing machines, I think :P)
#1deinterleave paired end fastq file 
 paste - - - - - - - - < sra_data \
| tee >(cut -f 1-4 | tr "\t" "\n" > /home/lols/Project/reads-1.fq) \
| cut -f 5-8 | tr "\t" "\n" > /home/lols/Project/reads-2.fq
 
     
    