-2
import argparse   
parser = argparse.ArgumentParser()
parser.add_argument("seconds", type = int, help = "int(args)")
args = parser.parse_args()

#seconds = 5
#print("You told me it will take {} seconds".format(seconds))
print("You told me it will take {} seconds".format(args))

the output should be : You told me it will take 5 seconds

closed as off-topic by João Farias, Nitin Rastogi, Bharat Mane, NarendraC, alecxe Jul 13 at 15:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development unrelated to testing are off-topic here, but can be asked on Stack Overflow." – João Farias, Nitin Rastogi, Bharat Mane, NarendraC, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This is a better question for StackOverflow, but parser.parse_args() returns an object. You need to access the seconds, so you should have something like: print("You told me it will take {} seconds".format(args.seconds)) – ernie Jul 11 at 15:44
  • @ernie it's a bad question for SO, too. OP you should read the argparse docs, which show you how to get the argument values back. – jonrsharpe Jul 11 at 16:21
  • @jonrsharpe sure; topic wise better for SO, but yes, a poor question in general. – ernie Jul 11 at 16:35

Browse other questions tagged or ask your own question.