zhilothebest
zhilothebest

Reputation: 313

Unable to import pexpect "windows only" methods

I have recently installed the pexpect 4.0 module, as it will be quite useful for the program I am creating. I do have windows, so I looked specifically at the exceptions for pexpect, knowing that the normal spawn and run methods aren't available to me. But, I cant get the "windows methods" that the module is supposed to show windows users, which are:

pexpect.popen_spawn.PopenSpawn, and pexpect.fdpexpect.fdspawn.

Does anyone have any idea how I can get these methods? I am running on windows 10, python 3.4.

Side note: I am currently working on trying to get winpexpect to import the spawn module from pexpect, but I am also failing at that as well.

Upvotes: 1

Views: 1707

Answers (1)

ivan7707
ivan7707

Reputation: 1156

This will do it for you:

from pexpect import popen_spawn, fdpexpect

Then you can do the rest of what you needed.

edit: this is the reason you did not see it, in the __init__.py notice this:

__all__ = ['ExceptionPexpect', 'EOF', 'TIMEOUT', 'spawn', 'spawnu', 'run','runu', 'which', 'split_command_line', '__version__', '__revision__']

Upvotes: 0

Related Questions