Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: PExpect on Windows System Using Cygwin

Reply
Thread Tools

Re: PExpect on Windows System Using Cygwin

 
 
Dave Angel
Guest
Posts: n/a
 
      09-24-2009
Kevin Holleran wrote:
> Hello,
>
> I downloaded and installed the pexpect module and wrote a script. All is
> well and good, but the script proved to be pretty useful and now I was asked
> to run it as a scheduled task up on a server to run periodically. I was
> intending on simply packaging it up with Py2Exe and moving it to the server
> that way.
>
> However, when I went to test it, I received this error....
>
> Traceback (most recent call last):
> File "script.py", line 17, in <module>
> import pexpect
> File "lib\site-packages\pexpect.py", line 85, in <module>
> support it. Pexpect is intended for UNIX-like operating systems.""")
> ImportError: No module named resource
>
> A critical module was not found. Probably this operating system does not
> support it. Pexpect is intended for UNIX-like operating systems.
>
> So now I realize that when I was testing on my system, I run cygwin and so
> everything worked fine....
>
> Is there a .dll that I can copy with it or anything so that it works without
> having to install cygwin on the server that will be hosting this scheduled
> task?
>
> Thanks for any help.
>
> Kevin
>
>

Why not just use the subprocess module? It's built into the Windows
distribution, and doesn't need cygwin.

DaveA
 
Reply With Quote
 
 
 
 
Sean DiZazzo
Guest
Posts: n/a
 
      09-25-2009
On Sep 24, 4:37*pm, Dave Angel <(E-Mail Removed)> wrote:
> Kevin Holleran wrote:
> > Hello,

>
> > I downloaded and installed the pexpect module and wrote a script. *All is
> > well and good, but the script proved to be pretty useful and now I was asked
> > to run it as a scheduled task up on a server to run periodically. *I was
> > intending on simply packaging it up with Py2Exe and moving it to the server
> > that way.

>
> > However, when I went to test it, I received this error....

>
> > Traceback (most recent call last):
> > * File "script.py", line 17, in <module>
> > * * import pexpect
> > * File "lib\site-packages\pexpect.py", line 85, in <module>
> > * * support it. Pexpect is intended for UNIX-like operating systems..""")
> > ImportError: No module named resource

>
> > A critical module was not found. Probably this operating system does not
> > support it. Pexpect is intended for UNIX-like operating systems.

>
> > So now I realize that when I was testing on my system, I run cygwin and so
> > everything worked fine....

>
> > Is there a .dll that I can copy with it or anything so that it works without
> > having to install cygwin on the server that will be hosting this scheduled
> > task?

>
> > Thanks for any help.

>
> > Kevin

>
> Why not just use the subprocess module? * It's built into the Windows
> distribution, and doesn't need cygwin.
>
> DaveA


Can subprocess pass things like passwords to running processes like
pexpect can?

~Sean
 
Reply With Quote
 
 
 
 
Dave Angel
Guest
Posts: n/a
 
      09-25-2009
Sean DiZazzo wrote:
> On Sep 24, 4:37 pm, Dave Angel <(E-Mail Removed)> wrote:
>
>>> <snip>
>>>

>> Why not just use the subprocess module? It's built into the Windows
>> distribution, and doesn't need cygwin.
>>
>> DaveA
>>

>
> Can subprocess pass things like passwords to running processes like
> pexpect can?
>
> ~Sean
>
>

I don't know what pexpect is/was capable of, since it's not apparently
part of the current Python distributions. I thought it had the ability
to fork or spawn a child process, with pipes connected.

Anyway, subprocess can launch a new process, with pipes optionally
connected back to your code. I don't think it can attach to an
already-running process.

There are things in pywin32 that might help (even for controlling GUI
programs), but I suspect there'd be a big learning curve. And of course
it'd then be very Windows-dependent.

pywin32 - http://python.net/crew/skippy/win32/Downloads.html
or get it as part of the ActiveState python distro.
http://www.activestate.com/activepython/


DaveA

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the system clock with pexpect confuses pexpect! Saqib Ali Python 1 12-26-2011 01:51 PM
cygwin python with Tkinter and pexpect module =?ISO-8859-15?Q?J=F6rg?= Maier Python 2 09-07-2003 09:05 PM
WELCOME to cygwin@cygwin.com cygwin-help@cygwin.com Python 1 09-05-2003 07:46 AM
confirm unsubscribe from cygwin-announce@cygwin.com cygwin-announce-help@cygwin.com Python 0 09-05-2003 01:29 AM
confirm unsubscribe from cygwin@cygwin.com cygwin-help@cygwin.com Python 0 09-04-2003 06:34 PM



Advertisments