Gatan | AMETEKSkip to Main Content
No options found

Simple dialogs

Python Script

The input command presents a simple dialog and returns the entered string. Some other simple prompted dialogs are provided by the plugin.

Preview

'''
The input command presents a simple dialog and returns the entered string.
Some other simple prompted dialogs are provided by the plugin.
'''
import DigitalMicrograph as DM

str = input( 'Please enter some string:' )
print( 'You have entered: ', str )

DM.OkDialog( 'Just press OK to continue' )  

bVal = DM.OkCancelDialog( 'Please select ok or cancel' )
print( 'You have pressed: ', bVal )

bVal, num = DM.GetNumber( 'Please enter a number', 123 )  
print( 'You have entered: ', num )
print( 'You have pressed: ', bVal )