1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
You can use read parameters like regular Python sys.argv arguments.
import sys
print "This is the name of the script: ", sys.argv[0]
print "Number of arguments: ", len(sys.argv)
print "The arguments are: " , str(sys.argv)
Alternatively, you can use Glue's getResolvedOptions to read the arguments by name. In this case, you will need to prepend the argument name with '--' e.g. --Arg1 Value1
from awsglue.utils import getResolvedOptions
args = getResolvedOptions(sys.argv, ['TempDir','JOB_NAME', 'Arg1'])
print "The args are: " , str(args)
print "The value is: " , args['Arg1']
답변함 7년 전
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 3년 전