OpenOutputDoc Method (Python)

Opens the specified output document and makes it the designated output document. The method returns an SpssOutputDoc object. By default, the associated Viewer window is invisible. Use the SetVisible method from the SpssOutputUI class to make the Viewer window visible. You get an SpssOutputUI object using the GetOutputUI method of the SpssOutputDoc object.

Syntax

SpssOutputDoc=SpssClient.OpenOutputDoc(fileName,password=None)

Parameters

fileName. The path and file name of the output document, as a string.

password. A string specifying the password required to open the file. Only applies to encrypted output files. The password can be specified as encrypted or unencrypted. Encrypted passwords are created when pasting command syntax, for an encrypted file, from the Save Output As dialog.

Example

import SpssClient
SpssClient.StartClient()
outputDoc = SpssClient.OpenOutputDoc(r"fileName")
outputUI = outputDoc.GetOutputUI()
outputUI.SetVisible(True)
SpssClient.StopClient()

On Windows, it is recommended to use raw strings for file paths, or replace backslashes with forward slashes (IBM® SPSS® Statistics accepts a forward slash for any backslash in a file specification). Raw strings are specified by prefacing the string with r, as in r'c:\examples\mydata.sav'. In raw mode, Python treats all backslashes in the string as the backslash character and not as the start of an escape sequence.