Skip to content
johnklee edited this page Apr 10, 2015 · 4 revisions

Introduction

Python 的 Pexpect 模組 提供使用者能夠與互動的程式進行溝通. 而這裡的 JExpect 可以想像成 Pexpect 模組 的 Java 版本, 並封裝到 Flib.jar 模組. 底下將針對該類別的使用進行介紹.

Usage Of JExpect

JExpect 上提供靜態方法 Spawn(String cmd) 讓你可以透過 Spawn 一個新的 Process 來執行給定命令:

/** 
 * BD: Spawn a Process by executing given command. 
 *  
 * @param cmd: Command to execute in Spawn process. 
 * @return 
 * @throws Exception 
 */  
public static ISpawnProcess Spawn(String cmd) throws Exception 

Clone this wiki locally