How do go into a directory without being given its full path in python 2?
<p>I am currently trying to go into a folder and call a python 2 script, but I cannot get any answer to go into a folder without using its full path. As example in DOS I would normally type this:</p>

<pre><code>C:\unknownpath\&gt; cd otherpath
C:\unknownpath\otherpath\&gt;
</code></pre>

<p>Thanks for any help.</p>

<p><code>os.chdir</code> works on relative path.</p>

<pre><code>&gt;&gt;&gt; os.getcwd()
'C:\\Users\\sba001\\PycharmProjects'
&gt;&gt;&gt; os.listdir('.')
['untitled', 'untitled1', 'untitled2', 'untitled3', 'untitled4', 'untitled5']
&gt;&gt;&gt; os.chdir('untitled')
&gt;&gt;&gt; os.getcwd()
'C:\\Users\\sba001\\PycharmProjects\\untitled'
</code></pre>

python