Re: PExpect Cross-Platform Alternative

Discussion in 'Python' started by Steve Holden, Feb 11, 2010.

  1. Steve Holden

    Steve Holden Guest

    Nathan Farrar wrote:
    > Hello Community,
    >
    > Recently I've been automating lots of network operations tasks via
    > simple python scripts. Originally, I utilized paramiko but found that
    > the module had issues working with cisco equipment. I switched to
    > pexpect and things have worked wonderfully since (I've been running this
    > scripts in a Linux environment). However, I was just tasked to get
    > these scripts running in a windows environment and to my dismay very
    > quickly realized that pexpect is not cross platform compatible.
    >
    > Am I stuck, or are there solutions out there?
    >

    It works pretty well under Cygwin (which also improves your Windows
    scripting environment no end). Any chance you would be allowed to
    install that?

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
    Holden Web LLC http://www.holdenweb.com/
    UPCOMING EVENTS: http://holdenweb.eventbrite.com/
    Steve Holden, Feb 11, 2010
    #1
    1. Advertising

  2. > > I was just tasked to get
    > > these scripts running in a windows environment and to my dismay very
    > > quickly realized that pexpect is not cross platform compatible.
    > > Am I stuck, or are there solutions out there?



    I haven't tried it, but here is another Python implementation of
    Expect that claims to run on Windows also:

    http://code.google.com/p/python-expect/

    -Corey
    corey goldberg, Feb 12, 2010
    #2
    1. Advertising

  3. Steve Holden

    Guest

    Hello Steve,

    I was wondering if you had working examples of your automated tasks in python ... I am asking because I am starting out in Python, and I believe I can save my company time and headaches by automating a lot of the tasks we have.
    I would like to study your code and see if I can use it in our environment.
    Basically, our tasks involve downloading the firmwares and then installing it, restarting the processes and making sure all the processes are running. Its on Linux servers and HP switches.

    I cannot seem to find any example code to learn from ... I have IT guys who know Perl, but I do not want to go down that route.

    Many thanks,

    Zac.


    On Thursday, February 11, 2010 8:57:39 PM UTC+1, Steve Holden wrote:
    > Nathan Farrar wrote:
    > > Hello Community,
    > >
    > > Recently I've been automating lots of network operations tasks via
    > > simple python scripts. Originally, I utilized paramiko but found that
    > > the module had issues working with cisco equipment. I switched to
    > > pexpect and things have worked wonderfully since (I've been running this
    > > scripts in a Linux environment). However, I was just tasked to get
    > > these scripts running in a windows environment and to my dismay very
    > > quickly realized that pexpect is not cross platform compatible.
    > >
    > > Am I stuck, or are there solutions out there?
    > >

    > It works pretty well under Cygwin (which also improves your Windows
    > scripting environment no end). Any chance you would be allowed to
    > install that?
    >
    > regards
    > Steve
    > --
    > Steve Holden +1 571 484 6266 +1 800 494 3119
    > PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
    > Holden Web LLC http://www.holdenweb.com/
    > UPCOMING EVENTS: http://holdenweb.eventbrite.com/
    , Sep 8, 2012
    #3
  4. Steve Holden

    Guest

    Hello Steve,

    I was wondering if you had working examples of your automated tasks in python ... I am asking because I am starting out in Python, and I believe I can save my company time and headaches by automating a lot of the tasks we have.
    I would like to study your code and see if I can use it in our environment.
    Basically, our tasks involve downloading the firmwares and then installing it, restarting the processes and making sure all the processes are running. Its on Linux servers and HP switches.

    I cannot seem to find any example code to learn from ... I have IT guys who know Perl, but I do not want to go down that route.

    Many thanks,

    Zac.


    On Thursday, February 11, 2010 8:57:39 PM UTC+1, Steve Holden wrote:
    > Nathan Farrar wrote:
    > > Hello Community,
    > >
    > > Recently I've been automating lots of network operations tasks via
    > > simple python scripts. Originally, I utilized paramiko but found that
    > > the module had issues working with cisco equipment. I switched to
    > > pexpect and things have worked wonderfully since (I've been running this
    > > scripts in a Linux environment). However, I was just tasked to get
    > > these scripts running in a windows environment and to my dismay very
    > > quickly realized that pexpect is not cross platform compatible.
    > >
    > > Am I stuck, or are there solutions out there?
    > >

    > It works pretty well under Cygwin (which also improves your Windows
    > scripting environment no end). Any chance you would be allowed to
    > install that?
    >
    > regards
    > Steve
    > --
    > Steve Holden +1 571 484 6266 +1 800 494 3119
    > PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
    > Holden Web LLC http://www.holdenweb.com/
    > UPCOMING EVENTS: http://holdenweb.eventbrite.com/
    , Sep 8, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jcc
    Replies:
    15
    Views:
    4,675
    Nigel Wade
    May 12, 2006
  2. Coca
    Replies:
    15
    Views:
    629
    Alan Balmer
    Jan 14, 2004
  3. markolopa
    Replies:
    0
    Views:
    313
    markolopa
    Feb 1, 2009
  4. Saqib Ali
    Replies:
    1
    Views:
    350
    Roy Smith
    Dec 26, 2011
  5. Kaspar Schiess

    platform.rb (was: PLATFORM tests)

    Kaspar Schiess, Nov 25, 2005, in forum: Ruby
    Replies:
    0
    Views:
    113
    Kaspar Schiess
    Nov 25, 2005
Loading...

Share This Page