interacting with shell - another newbie question
Larry Bates
larry.bates at websafe.com
Fri Feb 9 17:29:50 EST 2007
James wrote:
> Hello,
>
> I work in this annoying company where I have to autheticate myself to
> the company firewall every 30-50 minutes in order to access the
> internet. (I think it's a checkpoint fw).
>
> I have to run "telnet what.ever.ip.address 259" then it prompts me
> with userid, then password, then I have to select "1". Then the
> program closes itself and the internet is enabled.
>
> I would like to automate this process with Python and run it every 30
> miniutes so I don't have to keep typing in these userid/password
> everytime. How can this be done? Is there a module I can use to
> interact with the shell? (I'm running linux)
>
> Thank you.
>
> James
>
You shouldn't have to work through the shell. Just connect
directly via telnetlib. Here is an example that you should
be able to modify easily to meet your needs.
http://docs.python.org/lib/telnet-example.html
-Larry
More information about the Python-list
mailing list