Source

savReaderWriter / savReaderWriter / doc_tests / test_SavReader_file_report.txt

Full commit
##############################################################################
## Read a file and get some basic file info (reports)
##############################################################################

>>> import pprint
>>> import sys
>>> sys.stdout.write('<skipline> '); from savReaderWriter import * # doctest: +ELLIPSIS
<skipline> ...

## ... Get some basic file info
>>> savFileName = "../savReaderWriter/test_data/Employee data.sav"
>>> try:  # doctest: +ELLIPSIS
...     reader = SavReader(savFileName, ioLocale='en_US.UTF-8')      
...     print str(reader)
...     print unicode(reader)
... finally:
...     reader.close()
...
**********************************************************************
*File '../savReaderWriter/test_data/Employee data.sav' (24.32 kB) has 10 columns (variables) and 474 rows (4740 values)
*The file was created with SPSS version: MS Windows Release 11.0 spssio32.dll (11.1.0)
*The interface locale is: 'en_US.UTF-8'
*The interface mode is: Codepage (UTF-8)
*The file encoding is: 'utf_8' (Code page: 65001)
*File encoding and the interface encoding are compatible: Yes
*Your computer's locale is: '...' (Code page: ...)
*The file contains the following variables:
  01. id (F4 - numerical)
  02. gender (A1 - string)
  03. bdate (ADATE10 - numerical)
  04. educ (F2 - numerical)
  05. jobcat (F1 - numerical)
  06. salary (DOLLAR8 - numerical)
  07. salbegin (DOLLAR8 - numerical)
  08. jobtime (F2 - numerical)
  09. prevexp (F6 - numerical)
  10. minority (F1 - numerical)
**********************************************************************
<BLANKLINE>
**********************************************************************
*File '../savReaderWriter/test_data/Employee data.sav' (24.32 kB) has 10 columns (variables) and 474 rows (4740 values)
*The file was created with SPSS version: MS Windows Release 11.0 spssio32.dll (11.1.0)
*The interface locale is: 'en_US.UTF-8'
*The interface mode is: Codepage (UTF-8)
*The file encoding is: 'utf_8' (Code page: 65001)
*File encoding and the interface encoding are compatible: Yes
*Your computer's locale is: '...' (Code page: ...)
*The file contains the following variables:
  01. id (F4 - numerical)
  02. gender (A1 - string)
  03. bdate (ADATE10 - numerical)
  04. educ (F2 - numerical)
  05. jobcat (F1 - numerical)
  06. salary (DOLLAR8 - numerical)
  07. salbegin (DOLLAR8 - numerical)
  08. jobtime (F2 - numerical)
  09. prevexp (F6 - numerical)
  10. minority (F1 - numerical)
**********************************************************************
<BLANKLINE>