Table of Contents
Provides system level access to the MineSight®-3D application.
Of particular interest is the use of the stdout objects provided in this module that allow you to write data to the message window.
Python's print keyword provides a convenient method for outputting strings of text to the user. With MineSight® Grail Embedded you will be able output strings of text via the message window from within a Python script.
Starting with MineSight® Grail v3.60-02, all python print statements will be automatically redirected to the MineSight® 3-D Message window when MineSight® Grail is executed in an Embedded context.
You can re-instate the sys.stdout object to its original value at any time with the following line,
stdout
A file-like object that provides write() to perform standard output writes. For example the following line will print a string out to the message window,
mssys.stdout.write("Hello World!")A string will be written out to the message window whenever each time this call is made.
Changes made to this object include,
Starting with MineSight® Grail v3.60-03 this will be equivalent to sys.stdout, and the python print statement. So the following statements are equivalent within an Embedded Script,
print "Hello World!"
sys.stdout.write("Hello World!")
mssys.stdout.write("Hello World!")Starting with MineSight® Grail v4.50-00 the flush function will no longer have any effect.
stderr
A file-like object that provides write and flush to perform standard error output writes. For example the following line will print an error messages out to the message window,
mssys.stderr.write("This is an error message!")Changes made to this object include,
Starting with MineSight® Grail v3.60-03 this will be equivalent to sys.stderr object. So the following statements are equivalent within an Embedded Script,
sys.stderr.write("This is an error message!")
mssys.stderr.write("This is an error message!")Starting with MineSight® Grail v4.50-00 the flush function will no longer have any effect.
stdwarn
A file-like object that provides a write function to perform standard warning output writes. For example the following line will print a warning message to the message window,
mssys.stdwarn.write("This is a warning message\n")