Jump to content

Use Pexpect module in windows platform

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
ryanszeto

ryanszeto

    Newbie

  • Members
  • Pip
  • 9 posts
Hi guys,

I got a whole bunch of Python codes which makes use of a module called Pexpect, in which a function called spawn is used.

The codes were run in Unix platform originally and it runs beautifully. Right now, I have to move the codes to Windows platform to run. However, I found that the Pexpect module can only be used in Unix platform.

I want to ask: Is there any version of Pexpect that can be run in Windows platform? Or is there an alternative module that is similar to Pexpect?

Thanks for your help.

Ryan

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Pexpect is platform-independent, so there should be no problems in running it under Windows. If there is, though, can you specify it?

#3
ryanszeto

ryanszeto

    Newbie

  • Members
  • Pip
  • 9 posts
In the pexpect.py script, it tries to import a module called resource, which doesn't exist in the Python environment at all. And when try to run the script, it pops up "ImportError: no module named resource".

I have google-searched the resource module and found that it is actually a module contained in the Unix environment. Also, in the Pexpect Soundforge.net, it also specifies that Pexpect can only be run in Unix platform at the moment.

#4
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I don't think there's other libraries like Pexpect for Python - but I could be wrong.