FileNotFoundError: [WinError 2] The system cannot find the file specified:
<pre><code>import os

def rename(directory):
    for name in os.listdir(directory):
        print(name)
        os.rename(name,&quot;0&quot;+name)

        
path = input(&quot;Enter the file path&quot;)
rename(path)
</code></pre>
<p>I want to rename every file in a certain directory so that it adds a 0 to the beginning of the file name, however when I try to run the code it comes up with this error:</p>
<blockquote>
<p>(FileNotFoundError: [WinError 2] The system cannot find the file specified: '0.jpg' -&gt; '00.jpg')</p>
</blockquote>
<p>I'm sure that there is a file in there named <code>0.jpg</code> and I'm not sure what the problem is.</p>