Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pcl-expect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Cederqvist
pcl-expect
Commits
4e4f22be
Commit
4e4f22be
authored
Oct 6, 2003
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
Mention telnetlib.py.
parent
714b4970
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README
+28
-0
28 additions, 0 deletions
README
with
28 additions
and
0 deletions
README
+
28
−
0
View file @
4e4f22be
...
@@ -195,3 +195,31 @@ time, this seems to be a fairly mature and complete expect-like
...
@@ -195,3 +195,31 @@ time, this seems to be a fairly mature and complete expect-like
module.
module.
This is the only module that seems to be actively maintained.
This is the only module that seems to be actively maintained.
telnetlib.py
------------
The telnetlib.py module supplied with Python contains an expect
method.
Sample usage:
tn = Telnet()
tn.open(host, port)
ix, match, txt = tn.expect(["login:"])
tn.write("ceder\n")
ix, match, txt = tn.expect(["password:", "ceder@.*>"])
if ix == 0:
tn.write("secret\n")
ix, match, txt = tn.expect(["ceder@.*>"])
Why this isn't good enough:
- only supports telnet
- there is no way to wait for input from more than one process at a
time.
- no support for expect_after and expect_before
- cumbersome syntax
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment