Forum

Author Topic: How to provide arguments for python script  (Read 2149 times)

vathsasri321

  • Newbie
  • *
  • Posts: 3
    • View Profile
How to provide arguments for python script
« on: February 17, 2017, 12:03:22 PM »
Hi .

How will i give arguments for Agisoft Python Script ?

Can you give sample code for this?


Thanks in advance

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: How to provide arguments for python script
« Reply #1 on: February 17, 2017, 12:11:31 PM »
Hello vathsasri321,

Code: [Select]
import sys

for i in range (1, len(sys.argv)):
arg = sys.argv[i]
print("Argument " + str(i) + ": " + arg+ "\n")

This script should print all the arguments input to the Run Script field.
Best regards,
Alexey Pasumansky,
Agisoft LLC