def apply_operation():
 codon_table = codon_list.get(codon_list.curselection())
 print('Code: {}'.format(codon_table))
 seq = ''.join(input_text.get(1.0, tk.END).split())
 print('Input sequence: {}'.format(seq))
 operation = transform_var.get()
 print('Operation: {}'.format(operation))
 if (operation == 'transcribe'):
  result = transcribe(seq)
 elif (operation == 'translate'):
  result = translate(seq, table=codon_table, to_stop=True)
 elif (operation == 'back transcribe'):
  result = back_transcribe(seq)
 else:
  result = ''
 output_text.delete(1.0, tk.END)
 output_text.insert(tk.END, result)
 print('Result: {}'.format(result))
 return

def apply_operation ( ) : codon_table = codon_list . get ( codon_list . curselection ( ) ) print ( 'Code: {}' . format ( codon_table ) ) seq = '' . join ( input_text . get ( 1.0 , tk . END ) . split ( ) ) print ( 'Input sequence: {}' . format ( seq ) ) operation = transform_var . get ( ) print ( 'Operation: {}' . format ( operation ) ) if ( operation == 'transcribe' ) : result = transcribe ( seq ) elif ( operation == 'translate' ) : result = translate ( seq , table = codon_table , to_stop = True ) elif ( operation == 'back transcribe' ) : result = back_transcribe ( seq ) else : result = '' output_text . delete ( 1.0 , tk . END ) output_text . insert ( tk . END , result ) print ( 'Result: {}' . format ( result ) ) return
do the selected operation .