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

Reload the network configuration directly from a python sript ?

HIL

Hi everybody,

I wrote a python script to setup my network interface under Linux. To
perform it, I use directly from my python script external programs as
'ifconfig' and 'route' ans I fill the file /etc/resolv.conf with the good
nameserver IP. So, it it works and my network is up.

My problem is that when I use the function socket.gethostbyaddr just after
setting up the network and without getting out of my script, I get an
exception socket.herror. If I start my script again, now the function
socket.gethostbyaddr works correctly.

Python seems to load the network configuration at startup, and if network is
not set at this moment, it does not reload changes.

So, does someone know how to reload the network configuration directly from
my script without restarting it ?

Thanks by advance.

HIL
Oct 13 '05 #1
0 1401

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

Similar topics

66
by: Ellinghaus, Lance | last post by:
> > Other surprises: Deprecating reload() >Reload doesn't work the way most people think >it does: if you've got any references to the old module, >they stay around. They aren't replaced. ...
4
by: David MacQuigg | last post by:
I'm going to be teaching EEs some basic Python using the first few chapters of Learning Python, 2nd ed. by Mark Lutz. The discussion on Reloading Modules starting on page 266 is confusing and I...
2
by: metaperl | last post by:
Inheritance needed in app configuration ============================= I have an ftp server that a number of vendors connect into to upload a file to their directory. In OO terms, we would have ...
7
by: Aaron Gray | last post by:
Hi, I am having problems making Apache reload itself. I have tried a PHP exec calling a bash shell script that does a KILL -HUP on Apache to attempt to make it reload its configuration. The...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I force a reload from the server/prevent caching?...
6
by: Tony | last post by:
Hello! This is the scenarion that we want to implement. We have a computer called A which register itself on a superviser server about it's existence so other computer can get the...
0
by: Rafe | last post by:
Hi, This seems to be an old question, and I've read back a bit, but rather than assume the answer is "you can't do that", I'd thought I'd post my version of the question along with a...
0
by: John [H2O] | last post by:
I have set up the Python computing environment on a machine within a network to include the following Python modules: 1) Scipy 2) Numpy 3) Matplotlib v.98 or greater 4) Matplotlib toolkit...
0
by: nancylife | last post by:
When developing web report, many developers use VMware to simulate different operating systems on a same server. Then, they can realize cross-platform deployment and debug of web report. According to...
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: 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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.