![]() |
Help to activate the "USB Modem" with Python - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Help to activate the "USB Modem" with Python (/thread-5067.html) |
Help to activate the "USB Modem" with Python - karlo123 - Sep-17-2017 Hi everyone, I am trying to activate and deactivate the "usb modem" by Python code, but it does not work, do you know any way to do it? USB Modem: [Image: vodafonethestickusb.jpg] I tried with "cmd" command line but it did not work ![]() import os cmd = 'ifconfig wlan0 down' os.system(cmd) I appreciate very your comments Regards Karlo RE: Help to activate the "USB Modem" with Python - Larz60+ - Sep-17-2017 I don't see where this is related to python. RE: Help to activate the "USB Modem" with Python - Larz60+ - Sep-17-2017 Quote:I tried with "cmd" command line but it did not workshow complete script, how you ran it from cmd line and full verbatim traceback RE: Help to activate the "USB Modem" with Python - karlo123 - Sep-17-2017 Hi, I do it for wifi and it works, but it does not work for the usb modem: ------------------------------- import os, sys import time os.system("Ipconfig /release") time.sleep(3) os.system("Ipconfig /renew") ------------------------------ Do you know any other way? Thanks for the feedback RE: Help to activate the "USB Modem" with Python - sparkz_alot - Sep-17-2017 I presume you are using Windows and that the device is configured correctly and works without Python. The commands are ipconfig /renew <Adapter> and ipconfig /release <Adapter> .The Adapter option is only available for a device using DHCP. For devices using a static ip address you need to specify the adapter name, which can be found using ipconfig /all . Refer to MS Technet ipconfig.
|