aboutsummaryrefslogtreecommitdiff
path: root/tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2017-10-14 16:37:57 -0700
committerChristine Dodrill <me@christine.website>2017-10-14 16:37:57 -0700
commita248edc533dcc071a0998b5ad4e212e7e0523e0c (patch)
tree712ff716a5f6aa54b96a594f5bf1556361b572f8 /tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go
parentc3e60d5a5e316de0b4351346707a0a53d0d982ef (diff)
downloadx-a248edc533dcc071a0998b5ad4e212e7e0523e0c.tar.xz
x-a248edc533dcc071a0998b5ad4e212e7e0523e0c.zip
glue: add dep
Diffstat (limited to 'tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go')
-rw-r--r--tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go b/tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go
new file mode 100644
index 0000000..ea1208a
--- /dev/null
+++ b/tools/glue/vendor/github.com/ThomasRooney/gexpect/examples/python.go
@@ -0,0 +1,22 @@
+package main
+
+import "github.com/ThomasRooney/gexpect"
+import "fmt"
+
+func main() {
+ fmt.Printf("Starting python.. \n")
+ child, err := gexpect.Spawn("python")
+ if err != nil {
+ panic(err)
+ }
+ fmt.Printf("Expecting >>>.. \n")
+ child.Expect(">>>")
+ fmt.Printf("print 'Hello World'..\n")
+ child.SendLine("print 'Hello World'")
+ child.Expect(">>>")
+
+ fmt.Printf("Interacting.. \n")
+ child.Interact()
+ fmt.Printf("Done \n")
+ child.Close()
+}