expyriment.io.InputFile

class expyriment.io.InputFile(filename)

A class implementing an input file.

Methods

__init__(filename)

Create an input file.

All lines in the specified text file will be read into a list of strings.

Parameters :

filename : str, optional

name of the input file

current_line

Getter for current_line.

filename

Getter for filename.

get_line(line=None)

Get a specific line.

If no line is given, the current line will be returned and the value of current_line will be increased by one. First line is line 1.

Parameters :

line : int, optional

number of the line to get

Returns :

line : str

line as string or None if line does not exist

lines

Getter for lines.

n_lines

Getter for n_lines.

Previous topic

expyriment.io.GamePad

Next topic

expyriment.io.Keyboard

This Page