Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: jdyuen on March 13, 2012, 12:41:58 AM
-
Hello,
I have been playing around with python scripting and will definitely make use of it, but have run into a couple issues.
How can I write to the PhotoScan console from a python script loaded from Tools - Run Script...
For example, print("Hello World") works from the console but not from Run Script.
Also, when I "Run Script" and there are errors in the python, where is this written to? Nothing shows up for me in the PhotoScan console. Is there a way to direct stdout and stderr to the console?
Thanks!
-
To add on:
I can direct sterr and stdout to a file by doing the following at the beginning of the python script:
sys.stdout = open("out.txt","w")
sys.stderr = open("err.txt","w")
Still wondering how to direct to the PhotoScan console.
Thanks.
-
Hello jdyuen,
Are you sure that this script do not work if run "Run script" command is used:
import PhotoScan
print("Hello world")
Python errors are displayed in PhotoScan console starting version 0.8.5. You can try the latest pre-release version to check that - http://www.agisoft.ru/forum/index.php?topic=322.msg1291#msg1291
-
Hi Alexey,
Thanks for the quick reply. I am currently running version 0.8.4 which explains why it isn't working for me. I will try 0.8.5 (didn't know it was available!)