Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70878

Re: Hi. I want to create a script to read a file placed in a remote linux server using python..need help..?

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: Hi. I want to create a script to read a file placed in a remote linux server using python..need help..?
Date 2014-05-02 22:32 +0000
Organization A noiseless patient Spider
Message-ID <lk16di$854$1@dont-email.me> (permalink)
References <a6716c27-bd6d-4fc5-8932-55470a78deb2@googlegroups.com>

Show all headers | View raw


On Fri, 02 May 2014 12:55:18 -0700, Bhawani Singh wrote:

> I have created the script till here ..
> 
> import os
> 
> os.chdir("/var/log")
> fd = open("t1.txt", "r")
> for line in fd:
>     if re.match("(.*)(file1)(.*)", line):
>         print line,
> 
> Output :
> 
> file1
> 
> --------------------
> this script i ran on the linux server, but now i want to run this script
> from another linux server and get the output displayed there..how can i
> do that...
> 
> i tried to use : pexpect but getting no help..

Method a:

Go and sit in front of the keyboard on the other linux server, run the 
script and read the screen.

Method b:

Use telnet to login to your account on the other server, run the script.

To run your script on someone elses machine usually needs you to be able 
to access their machine somehow. Either you are permitted to do it, in 
which case you should already know how to do it, or you're not permitted 
to do it, in which case we're not going to teach you how to do it here.

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Hi. I want to create a script to read a file placed in a remote linux server using python..need help..? Bhawani Singh <bhawani90@gmail.com> - 2014-05-02 12:55 -0700
  Re: Hi. I want to create a script to read a file placed in a remote linux server using python..need help..? Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-02 22:32 +0000
    Re: Hi. I want to create a script to read a file placed in a remote linux server using python..need help..? Roy Smith <roy@panix.com> - 2014-05-02 18:51 -0400

csiph-web