title: Save queue data in Python
body: <p>I have written a Python class, Queue. This class basically adds, removes and re-arranges the data in the queue. </p>
  
  <p>How to save the data of the Queue? Whenever I re-run my code, all the data inside the queue is lost. </p>
  
  <p>How to save the data so that, I can use the previous saved data?</p>
  
  <p>This is the small code for the same .... </p>
  
  <pre><code>class Queue:
  
      def __init__(self):
          self.queue = list()
  
      def add(self, item):
          if item not in self.queue:
              self.queue.insert(0, item)
              return True
          return False
  
      def remove(self):
          print("Element Popped")
          return self.queue.pop()
  
      def size(self):
          return len(self.queue)
  
      def search_queue(self, item):
          with queue.mutex:
              if item in self.queue:
                  flag = 1
              else:
                  flag = 0
              return flag
  
      def arrange_queue(self, item):
          ..............
          ..........
          .....
  </code></pre>