Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: michaelzhangxc on April 07, 2014, 06:08:45 PM
-
I tried to input arguments to a script through Run Python Script dialogue window, but failed. The code is is as below:
AA=input('input argument AA:')
print (AA)
bb=input('input argument bb:')
print (bb)
Reffer the attached picture.
Console message:
Traceback (most recent call last):
File "C:/Python33/try.py", line 4, in <module>
AA=input('input argument AA:')
RuntimeError: input(): lost sys.stdin
Anyone can help? Thanks in advance.
-
Hello michaelzhangxc,
You need to use sys module to access arguments:
import PhotoScan
import sys
input = sys.argv[1]
print(input)
Please note that "input" variable is string.
-
that was quick Alexey, thank you. Now it works perfect.