Forum

Author Topic: force refresh console ?  (Read 4081 times)

stephan

  • Full Member
  • ***
  • Posts: 129
    • View Profile
force refresh console ?
« on: August 24, 2018, 02:29:34 PM »
Hi guys,

Let's say I want to do this:

Code: [Select]
for i in range(10):
    print(str(i))
    time.sleep(0.5)


In the Photoscan Python console I get an output of all "print" functions once the complete loop is finished, ie after 10*0.5 seconds. Is there a way to force refresh the console after every iteration like a normal python console ?

Kind regards,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15371
    • View Profile
Re: force refresh console ?
« Reply #1 on: August 24, 2018, 10:24:15 PM »
Hello stephan,

I think it has been discussed in the following thread:
http://www.agisoft.com/forum/index.php?topic=9062.msg42799#msg42799

You need to update the application window:

Code: [Select]
from PySide2 import QtWidgets
app = QtWidgets.QApplication.instance()
for i in range(10):
    app.processEvents()
    print(str(i))
    time.sleep(0.5)
Best regards,
Alexey Pasumansky,
Agisoft LLC