473,382 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problems with rlogin and executing a script

Hi all

I work with Suse Linux 8.2 and Python 2.2.2
I'm trying to make a python script which makes a rlogin to another
system and executes there another script. So it looks like this:

os.system("rlogin <hostname>")
os.system("./myscript.py")

The rlogin is ok. I can give in my password and i'm on the other host.
But the script goes not on until i exit the rlogin. How can a execute a
command on the new machine on which i'm logged in?
Jul 18 '05 #1
2 4300
Lukas Schnieper fed this fish to the penguins on Wednesday 01 October
2003 12:59 am:

os.system("rlogin <hostname>")
os.system("./myscript.py")
Won't work.

EACH os.system() call is the equivalent of opening a new command
interpreter window. So what you have is the first call doing the remote
login, and then exiting, followed by the second os.system() creating a
new environment and trying to execute locally.
The rlogin is ok. I can give in my password and i'm on the other host.
But the script goes not on until i exit the rlogin. How can a execute
a command on the new machine on which i'm logged in?
Check the various popen family. Though you may have to write the
entire sequence first before you can read the returns...

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #2
Lukas Schnieper <sc*******@semafor.ch> wrote in message news:<ma**********************************@python. org>...
Hi all

I work with Suse Linux 8.2 and Python 2.2.2
I'm trying to make a python script which makes a rlogin to another
system and executes there another script. So it looks like this:

os.system("rlogin <hostname>")
os.system("./myscript.py")

The rlogin is ok. I can give in my password and i'm on the other host.
But the script goes not on until i exit the rlogin. How can a execute a
command on the new machine on which i'm logged in?


It looks like your calling myscript.py from your local system, not the
remote system. You should probably try the Pexpect module (
http://pexpect.sourceforge.net/ ), which will let you control a
command line program like rlogin or ssh.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Markku Uttula | last post by:
I think I'm doing something wrong. I'm able to connect to Oracle just fine, execute queries and all, but I'm having serious problems with the speed :( For example, the following PHP-script on my...
2
by: walala | last post by:
Dear all, I recently came across a Python program which used "telnetlib" to automate things in the several unix machines in our local networks; I attached the script as follows; I wonder if...
0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is...
0
by: David H | last post by:
Background. I'm running on WinXP w/ MS Services for Unix installed (to give rsh/rlogin ability), both Python 2.3 and 2.4 version. In linux, I'm running RHEE with python2.3 version. The code...
1
by: Bryan Hesters | last post by:
I'm trying to build a Win32 application that will log into a PBX via RLogin. I'm not very versed in protocol programming and all the examples I can find on the internet are either linux based (GNU...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
55
by: drhowarddrfine | last post by:
I'm working on a web site that could use some control using js but am concerned about what problems I may have with potential users having their js turned off. Has anyone had any serious problems...
0
by: Ian Warford | last post by:
Hi, I have a problem with a PL/PerlU function trying to execute an external perl script. The script is suid to a non-root user and I am executing it in the PL/PerlU function as so : $rc =...
0
by: Sebastien Dupont | last post by:
Hi, I'm having a problem with executing a subprogram from a Python script. The subprogram is written in VBS (os = Win Server 2003). When I execute the Python script manually, the VBS script...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.