title: Pause and resume a running script in Python 3.42 in Windows
body: <p>I'm new to Python and have been googling for a couple of days and read all I can find on this forum. Might be that I don't understand it all but I haven't found a solution to my problem yet. Ask for forgiveness already if there's an answer already to my problem, then I haven't understood it.</p>
  
  <p>I want to make a Pause function for my program Tennismatch. The program will when it's being run print the score of a tennis match like this: "15-0, 15-15 etc ongoing till the match ends. It will print the score line by line.</p>
  
  <p>I want the user to be able to pause after x number of balls, games, etc. So I don't know when the user wants to pause and after the user has paused I want the user to be able to resume the tennismatch where it was. </p>
  
  <p>Have seen the time.sleep() but as I have understood it you must know when you want to pause to use this and it also ain't an indefinetie pause like I want. With input() it's the same. </p>
  
  <p>Am going to make a GUI later on when the code is finished. Happy for anything that leads me to solving my problem. </p>
  
  <p>I use Windows and Python 3.42 and run the program in Shell.</p>
  
  <p>A piece of the code (haven't written it all yet, it's more of a general situation when something is being printed line after line for some time and want to be able do pause in the CIL:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>#self.__points = [0,0]
  def playGame(self):
      if self.server == True:       #self.server is either True or False when someone calls playGame()
          server = self.player_1.get_win_serve()   #self.player_1 = an object of a class Player():
      else:
          server = self.player_2.get_win_serve()   #get_win_serve() method returns the probability to win his serv (1-0)
      while (0 &lt; self.__points[0] - self.__points[1] &gt;= 2 or 0 &lt; self.__points[1] - self.__points[0] &gt;= 2) and (self.__points[1] &gt;= 4 or self.__points[0] &gt;= 4): 
          x = random.uniform(0,1)    
          if x &gt; 0 and x &lt; server:
              self.__points[0] += 1
              
          else:
              self.__points[1] += 1
  
              # print('The score, by calling a score() function that I haven't written yet')</code></pre>
  </div>
  </div>
  </p>