473,386 Members | 1,679 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,386 software developers and data experts.

Python to check status of the port in linux machine

Hi ALL,

I'm working on a module installation script for linux using python,
I need a ex script to check wheather the port is free or listening before using it for installtion,
EX: Imagine if the port 1234 is already used for some process in the liunux machine 5.6.7.8,
This can be found using command
$netstat -anp | grep 1234

if u guys know how to invoke and check the same, i need to use the result of the above command in my python for further process i used os.system() command but the output is not as expected,
Dec 23 '11 #1
1 2295
dwblas
626 Expert 512MB
Subprocess replaces os.system. See "Capturing Output" here.
Dec 24 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: dananrg | last post by:
I have Python 2.1 / PythonWin 2.1 installed on my machine because I need it for use with ESRI's ArcGIS Desktop software, but I want to play with a more recent version of Python. Is it safe to...
0
by: Peter Chant | last post by:
I hope no one minds me running this past them. I'm running a linux machine with with apache, php and mysql. This is not accessable from the internet. I want a server that is visable to the...
20
by: Ramdas | last post by:
How do I add users using Python scripts on a Linux machine? Someone has a script?
39
by: Jack | last post by:
I wonder what everybody uses for Python editor/IDE on Linux? I use PyScripter on Windows, which is very good. Not sure if there's something handy like that on Linux. I need to do some development...
1
by: rocket1356 | last post by:
Anyone know what component or where to get a tutorial on how to connect to a LINUX machine using a VB app? I am trying to create a WIN32 Visual Basic application that communicates with a LINUX...
3
Banfa
by: Banfa | last post by:
So the title pretty much says it. I am attempting to switch to Linux but the printer attached to my machine must still be accessible by my wife who uses Windows. Alternatively attaching the...
1
by: tvnaidu | last post by:
I have Linux machine and windows machine on same network, I want to keep Linux machine as CVS server and windows machine as CVS client, can I keep like that?. My development machine is windows...
1
by: tvnaidu | last post by:
I have Redhat Linux machine with single ethernet interface, I need to test Iptables, Is one ethernet good enough to test iptables?. Currently I can do ssh, ftp into redhat machine, also if I want...
3
by: tvnaidu | last post by:
running minicom to access serial port usinh putty to Linux machine, minicom windpw is small and fixed, can't change size, any idea?
1
by: tvnaidu | last post by:
I can't do ssh into linux machine, looklike key not matching, not sure whether it is using rsa_key/dsa_key, can I force to use only one type of key?. incase if key not match, can't I success ssh...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.