Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-18-2014, 06:53 AM
morgun morgun is offline
Registered User
 
Join Date: Dec 2014
Posts: 8
pexpect with SecureCRT

Hello, I have many scripts in pexpect. At work we use SecureCRT and I need to run these scripts in it.

Please advice me how to import the pexpect library into SecureCRT.
Thanks
Reply With Quote
  #2  
Old 12-18-2014, 09:07 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,546
Hello morgun,

My understanding is that pexpect is a Python module. You can run Python scripts in SecureCRT.

What version of SecureCRT are you using?

On what platform?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-19-2014, 02:36 AM
morgun morgun is offline
Registered User
 
Join Date: Dec 2014
Posts: 8
Hello I am using version 7.2.3 on Windows. And yes it is Python module, which combines python and expect.
Reply With Quote
  #4  
Old 12-19-2014, 10:33 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,546
Hello morgun,

My understanding is there is not a native Pexpect module for Windows.

Do you have Cygwin installed on your Windows OS?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 12-23-2014, 03:33 AM
morgun morgun is offline
Registered User
 
Join Date: Dec 2014
Posts: 8
Hello, yes I have cygwin installed.
I have admin right so please feel free to put here the whole procedure how to make it work. I can install necessary modules, tools as needed.
Thanks
Reply With Quote
  #6  
Old 12-23-2014, 09:05 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,546
Hello morgun,

You will need to install pexpect and then include an "import module" line in your Python script (ie: import pexpect). That is the extent that SecureCRT is involved.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 01-06-2015, 04:44 AM
ogun ogun is offline
Registered User
 
Join Date: Sep 2013
Posts: 15
Actually, since pexpect is a pure python module no extra software is needed.

Download the latest pexpect code from github (https://github.com/pexpect/pexpect/archive/master.zip), unpack it somewhere and copy the pexpect folder inside to the same folder that your script is in. That's the pexpect folder on the same level as the doc, examples, test, notes etc folders.

With that done, you can just
Code:
import pexpect
in your code.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT -6. The time now is 02:00 AM.