original_docstring: Process to add the questions to a new frame, typeofsearch can be either 'all' or 'category' 
docstring: Process to add the questions to a new frame, typeofsearch can be either 'all' or 'category'
docstring_tokens: Process to add the questions to a new frame typeofsearch can be either ' all ' or ' category '
code: def search(self, typeofsearch, event=None):
          '''Process to add the questions to a new frame, typeofsearch can be either 'all' or 'category' '''
          self.string.set('') #deleting big text
          self.label.pack_forget()
          #self.window.geometry('750x500')
  
          foundquestions = []
  
          #creating a list if clicked on one label (self because used in other methods)
          self.labelList = []
  
          if typeofsearch == 'all':
              for question in questionList:
                  for query in [question[0],question[1],question[2]]:
                      if ((self.entry.get().lower() in query.lower()) or self.entry.get().lower() == query.lower()) and (question not in foundquestions): #if entry in question or answer and not found already
                          if typeofsearch == 'category' and question[0] == main.category: #if type is category then only add if category is same as category selected
                              foundquestions.append(question)
                          elif typeofsearch == 'all':
                              foundquestions.append(question)
  
          if typeofsearch == 'category':
              for question in questionList:
                  for query in [question[0],question[1],question[2]]:
                      if ((self.entry.get().lower() in query.lower()) or self.entry.get().lower() == query.lower()) and (question not in foundquestions) and (question[0] == main.category): #if type is category then only add if category is same as category selected
                          foundquestions.append(question)
  
          #if there is already searched frames
          try:
              self.grandframe.pack_forget()
          except AttributeError:
              pass
  
          foundquestions.sort(key=lambda x: x[0]) #sorts the list so subjects are joined together
  
          self.grandframe = VerticalScrolledFrame(self.window)
          self.grandframe.pack(expand=True)
  
          c.execute('SELECT * FROM subjects')
          colours = {}
          for x in c.fetchall():
              colours[x[0]] = x[1]
  
          #creating frames for them all
          for question in foundquestions:
              frame = Frame(self.grandframe.interior)
              frame2 = Frame(frame)
  
              each = Label(frame2, text=question[0], fg=colours[question[0]], font=font12Underlined, cursor='hand2')
              each.bind('<Button-1>',self.eventhandler)
              each.pack(side=LEFT)
  
              self.labelList.append([each,question]) #adds all questions to a list with widget no. and question
  
              frame2.pack(anchor='w')
  
              string = question[2] + ' -> ' + question[1]
              Label(frame, text=string, font=font12, wraplength=700, anchor='w', justify='left').pack(side=LEFT)
  
              frame.pack(pady=5, padx=10, anchor='w')
code_tokens: def search ( self , typeofsearch , event = None ) : self . string . set ( '' ) self . label . pack_forget ( ) foundquestions = [ ] self . labelList = [ ] if typeofsearch == 'all' : for question in questionList : for query in [ question [ 0 ] , question [ 1 ] , question [ 2 ] ] : if ( ( self . entry . get ( ) . lower ( ) in query . lower ( ) ) or self . entry . get ( ) . lower ( ) == query . lower ( ) ) and ( question not in foundquestions ) : if typeofsearch == 'category' and question [ 0 ] == main . category : foundquestions . append ( question ) elif typeofsearch == 'all' : foundquestions . append ( question ) if typeofsearch == 'category' : for question in questionList : for query in [ question [ 0 ] , question [ 1 ] , question [ 2 ] ] : if ( ( self . entry . get ( ) . lower ( ) in query . lower ( ) ) or self . entry . get ( ) . lower ( ) == query . lower ( ) ) and ( question not in foundquestions ) and ( question [ 0 ] == main . category ) : foundquestions . append ( question ) try : self . grandframe . pack_forget ( ) except AttributeError : pass foundquestions . sort ( key = lambda x : x [ 0 ] ) self . grandframe = VerticalScrolledFrame ( self . window ) self . grandframe . pack ( expand = True ) c . execute ( 'SELECT * FROM subjects' ) colours = { } for x in c . fetchall ( ) : colours [ x [ 0 ] ] = x [ 1 ] for question in foundquestions : frame = Frame ( self . grandframe . interior ) frame2 = Frame ( frame ) each = Label ( frame2 , text = question [ 0 ] , fg = colours [ question [ 0 ] ] , font = font12Underlined , cursor = 'hand2' ) each . bind ( '<Button-1>' , self . eventhandler ) each . pack ( side = LEFT ) self . labelList . append ( [ each , question ] ) frame2 . pack ( anchor = 'w' ) string = question [ 2 ] + ' -> ' + question [ 1 ] Label ( frame , text = string , font = font12 , wraplength = 700 , anchor = 'w' , justify = 'left' ) . pack ( side = LEFT ) frame . pack ( pady = 5 , padx = 10 , anchor = 'w' )
short_docstring: Process to add the questions to a new frame, typeofsearch can be either 'all' or 'category'
short_docstring_tokens: Process to add the questions to a new frame typeofsearch can be either ' all ' or ' category '
comment: '''Process to add the questions to a new frame, typeofsearch can be either 'all' or 'category' '''$SEP$#deleting big text
  $SEP$#self.window.geometry('750x500')
  $SEP$#creating a list if clicked on one label (self because used in other methods)
  $SEP$#if entry in question or answer and not found already
  $SEP$#if type is category then only add if category is same as category selected
  $SEP$#if type is category then only add if category is same as category selected
  $SEP$#if there is already searched frames
  $SEP$#sorts the list so subjects are joined together
  $SEP$#creating frames for them all
  $SEP$#adds all questions to a list with widget no. and question
  