page

Sets or retrieves the page width or length.

Synopsis

page (option, pageAttribute)

Required Arguments

int option (Input)
Option giving which page attribute is to be set or retrieved. The possible values are:
option Description
SET_PAGE_WIDTH Set the page width.
GET_PAGE_WIDTH Retrieve the page width.
SET_PAGE_LENGTH Set the page length.
GET_PAGE_LENGTH Retrieve the page length.
int pageAttribute (Input, if the attribute is set; Output, otherwise)
The value of the page attribute to be set or retrieved. The page width is the number of characters per line of output (default 78), and the page length is the number of lines of output per page (default 60). Ten or more characters per line and 10 or more lines per page are required.

Example

The following example illustrates the use of page to set the page width to 40 characters. The PyIMSL function writeMatrix is then used to print a 3 × 4 matrix A, where \(a_{ij}=i+j/10\).

from numpy import *
from pyimsl.math.page import page, SET_PAGE_WIDTH
from pyimsl.math.writeMatrix import writeMatrix

nra = 3
nca = 4
a = zeros((nra, nca), dtype='double')
for i in range(0, nra):
    for j in range(0, nca):
        a[i, j] = (i + 1) + (j + 1) / 10.0

page(SET_PAGE_WIDTH, 40)

writeMatrix("matrix\na", a)

Output

 
                 matrix
                    a
             1            2            3
1          1.1          1.2          1.3
2          2.1          2.2          2.3
3          3.1          3.2          3.3
 
             4
1          1.4
2          2.4
3          3.4