title: python worm how to make it more complex?
body: <p>Please be kind this is my second post and i hope you all like.
  Here I have made a program that makes directories inside directories,
   but the problem is I would like a way to make it self replicate.
  Any ideas and help is greatly appreciated.</p>
  
  <p>Before: </p>
  
  <pre><code>user/scripts
  </code></pre>
  
  <p>After: </p>
  
  <pre><code>user/scripts/worm1/worm2/worm3
  </code></pre>
  
  <p>The script is as follows:</p>
  
  <pre><code>import os, sys, string, random
  worms_made = 0
  stop = 20
  patha = ''
  pathb = '/'
  pathc = ''
  def fileworm(worms_made, stop, patha, pathb, pathc):
      filename = (''.join(random.choice(string.ascii_lowercase 
      +string.ascii_uppercase + string.digits) for i in range(8)))
      pathc = patha + filename + pathb
      worms_made = worms_made + 1
      os.system("mkdir %s" % filename)
      os.chdir(pathc)
      print "Worms made: %r" % worms_made
      if worms_made == stop:
          print "*Done"
          exit(0)
      elif worms_made != stop:
          pass  
      fileworm(worms_made, stop, patha, pathb, pathc)
  
  fileworm(worms_made, stop, patha, pathb, pathc)
  </code></pre>