title: Incremental UUID generator in python
body: <p>I'm working on project that need to make unique and incremental file names.I found <a href="https://stackoverflow.com/questions/534839/how-to-create-a-guid-uuid-in-python">UUID</a> best way for making unique names but being incremental is already unanswered.We have such a situation that our list will recreate after reboot based on saved file.and creating new files by adding to previous list.<br/>
  my tried program is simple:</p>
  
  <pre><code>import uuid
  print(uuid.uuid4().hex)
  print(uuid.uuid4().hex)
  print(uuid.uuid4().hex)
  print(uuid.uuid4().hex)
  </code></pre>
  
  <p>and sample output is this:</p>
  
  <pre><code>e497b7d7651341e0ac214fea8c408a7b
  5d956a98724c459796ef1fce3818ff45
  e60f2517ac1a430eab84768dae9e49a1
  9df26e765dee4c3197c2f5a69e210046
  </code></pre>
  
  <p>(This result will totally different from run to run)<br/>
  as you can see there is no guaranty that new UUID will be greater/smaller than previous one.</p>
  
  <blockquote>
    <p>What I want is something like <a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql" rel="nofollow noreferrer">NEWSEQUENTIALID</a> in Sql Server</p>
  </blockquote>
  
  <p>Thank you in advance ;)</p>