title: Python how to get permutations one by one
body: <p>I'm looking for code which gives me permutations of the numbers in the range 0-9.</p>
  
  <p>The permutations should be of length <code>x</code> and the numbers can repeat.</p>
  
  <p>I want to get these permutations one by one. When I find the permutations I need, I don't need the remaining ones.</p>
  
  <p>All possibilities I have found so far give me all permutations simultaneously and it takes too much time to generate all of them.  </p>