OpenDataDoc Method (Python)
Opens the specified data document and makes it the active dataset. The method returns an SpssDataDoc object.
- This method is not available when called from a Python
program in distributed mode (Python programs make use of the interface
exposed by the Python
spssmodule).
Syntax
SpssDataDoc=SpssClient.OpenDataDoc(fileName,password=None)
Parameters
fileName. The path and file name of the data document, as a string.
password. A string specifying the password required to open the file. Only applies to encrypted data 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 Data As dialog.
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.