title: How to give windows directory path in os.listdir(path)?
body: <p>While I'm trying to give windows directory path in os.listdir() it gives error.
   My code snippet:</p>
  
  <pre><code>with os.listdir('C:\Users\Hp\Desktop\video') as entries:
  </code></pre>
  
  <p>I know that python takes '\' as an escape sequence but I cannot find any alternative on windows. The error given out is:</p>
  
  <pre><code>SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX
  </code></pre>
  
  <p>I've tried below solutions but it gave me some other error:-</p>
  
  <pre><code>AttributeError: __enter__
  </code></pre>
  
  <p>Is there any problem with my code:</p>
  
  <pre><code>import os
  import moviepy.editor as mp
  
  #location = os.path.join("C:", "Users", "Hp", "Desktop", "video")
  
  with os.listdir("C:\\Users\\Hp\\Desktop\\video") as entries:
      for entry in entries:
          if(".py" or ".png") not in entry:
              video = mp.VideoFileClip("entry.name")
  
              logo = (mp.ImageClip("logo.png")
                        .set_duration(video.duration)
                        .resize(height=50) # if you need to resize...
                        .margin(right=8, top=8, opacity=0) # (optional) logo-border padding
                        .set_pos(("right","top")))
  
              final = mp.CompositeVideoClip([video, logo])
              final.write_videofile('o' + "entry.name")
  </code></pre>