Off topic:path to a directory as argparse argument
0
0
Entering edit mode
7.8 years ago
ahmedakhokhar ▴ 150

Problem: I want a write a directory's path as user's input in an add.argument of ArgumentParser().

So far: I have written this

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('path', option = os.chdir(input("paste here path to biog.txt file:")), help= 'paste path to biog.txt file')

Any idea's, what would be the ideal solution of this problem ?

argparse python • 3.6k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2442 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6