title: how save a file in Python whose name has slashes in it
body: <p>I am looping through a series of names in a tuple and I want to save the output during each loop using the tuple data as the filename. However the names have slashes in them.</p>
  
  <pre><code>layers = ['conv1/7x7_s2','pool1/3x3_s2']
  for idx,layer in enumerate(layers):
      result=deepdream(net, img, end=layer)
      imag = PIL.Image.fromarray(result,'RGB')
      imag.save('files/'+str(layer)+'.png')
  </code></pre>
  
  <p>result contains a numpy array
  imag is the image
  layer is what i want the filename to be</p>
  
  <p>However, the slash is being interpreted as a directory delimiter
  Is there any way to save the image as
  conv1/7x7_s2.png</p>
  
  <p>or should I just convert the slash to a dash?</p>