path to a directory as argparse argument
<p>I want to accept a directory path as user input in an <code>add_argument()</code> of <code>ArgumentParser()</code>.</p>
<p>So far, I have written this:</p>
<pre><code>import argparse

parser = argparse.ArgumentParser()
parser.add_argument('path', option = os.chdir(input(&quot;paste here path to biog.txt file:&quot;)), help= 'paste path to biog.txt file')
</code></pre>
<p>What would be the ideal solution to this problem?</p>