title: How to display a random picture from a folder?
body: <p>I have to display a random image from a folder using Python. I've tried</p>
  <pre><code>import random, os
  random.choice([x for x in os.listdir(&quot;path&quot;)if os.path.isfile(x)])
  </code></pre>
  <p>but it's not working for me (it gives Windows Error: wrong directory syntax, even though I've just copied and paste).</p>
  <p>Which could be the problem...</p>