File: examples.html

package info (click to toggle)
pexpect 2.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 584 kB
  • ctags: 701
  • sloc: python: 3,036; makefile: 46
file content (121 lines) | stat: -rw-r--r-- 3,791 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Pexpect - Examples</title>
<link rel="stylesheet" href="clean.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Noah Spurrier">
<meta name="Keywords"
 content="pexpect, Noah Spurrier, pypect, Python, Libes, TCL, Expect, pipe, popen, pyExpect, expectpy, expect-like, expect-alike, expect like">
<meta name="Description"
 content="Examples for using Pexpect.">
</head>
<body bgcolor="#ffffff" text="#000000">
<div id="Header">
<h1>Pexpect Examples</h1>
</div>
<div id="Content">
<p><span class="code">script.py</span></p>
<p><blockquote>
 This implements a command similar to the classic BSD
"script" command.
 This will start a subshell and log all input and
output to a file.
 This demonstrates the interact() method of Pexpect.
</p></blockquote>

<p><span class="code">fix_cvs_files.py</span></p>
<p><blockquote>
 This is for cleaning up binary files improperly
added to CVS.
 This script scans the given path to find binary
files;
 checks with CVS to see if the sticky options are set
to -kb;
 finally if sticky options are not -kb then uses 'cvs
admin' to
 set the -kb option.
</p></blockquote>

<p><span class="code">ftp.py</span></p>
<p><blockquote>
 This demonstrates an FTP "bookmark".
 This connects to an ftp site; does a few ftp stuff;
and then gives the user
 interactive control over the session. In this case
the "bookmark" is to a
 directory on the OpenBSD ftp server. It puts you in
the i386 packages
 directory. You can easily modify this for other
sites.
 This demonstrates the interact() method of Pexpect.
</p></blockquote>

<p><span class="code">monitor.py</span></p>
<p><blockquote>
 This runs a sequence of commands on a remote host
using SSH.
 It runs a simple system checks such as uptime and
free to monitor
 the state of the remote host.
</p></blockquote>

<p><span class="code">passmass.py</span></p>
<p><blockquote>
 This will login to each given server and change the
password of the
 given user. This demonstrates scripting logins and
passwords.
</p></blockquote>

<p><span class="code">python.py</span></p>
<p><blockquote>
 This starts the python interpreter and prints the
greeting message backwards.
 It then gives the user iteractive control of Python.
It's pretty useless!
</p></blockquote>

<p><span class="code">rippy.py</span></p>
<p><blockquote>
 This is a wizard for mencoder. It greatly simplifies
the process of
 ripping a DVD to Divx (mpeg4) format. It can
transcode from any
 video file to another. It has options for resampling
the audio stream;
 removing interlace artifacts, fitting to a target
file size, etc.
 There are lots of options, but the process is simple
and easy to use.
</p></blockquote>

<p><span class="code">sshls.py</span></p>
<p><blockquote>
 This lists a directory on a remote machine.
</p></blockquote>
<p><span class="code">ssh_tunnel.py</span></p>
<p><blockquote>
 This starts an SSH tunnel to a remote machine. It
monitors the connection
 and restarts the tunnel if it goes down.
</p></blockquote>
<p><span class="code">uptime.py</span></p>
<p><blockquote>
 This will run the uptime command and parse the
output into variables.
 This demonstrates using a single regular expression
to match the output
 of a command and capturing different variable in
match groups.
 The grouping regular expression handles a wide variety of different
uptime formats.
  </blockquote>
<p>
<a href="http://sourceforge.net/projects/pexpect/"
 title="The Pexpect project page on SourceForge.net"> <img
 src="http://sourceforge.net/sflogo.php?group_id=59762&amp;type=5"
 alt="The Pexpect project page on SourceForge.net" border="0"
 height="31" width="105"> </a> </div>
</body>
</html>