Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Is it possible to pass arguments into a Python script?

I know how to pass arguments into a shell script. These arguments are declared in AWS datapipeline and passed through. This is what a shell script would look like:
firstarg=$1
secondarg=$2


How do I do this in Python? Is it the exact same?
by

1 Answer

Kajalsi45d
This worked for me:
import sys
firstarg=sys.argv[1]
secondarg=sys.argv[2]
thirdarg=sys.argv[3]

Login / Signup to Answer the Question.