update docstring + remove 'import pexpect'
preview: replace "formatstr" kwarg by "preamble"