Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have done small correction in the script #46

Open
abidmaria opened this issue Dec 10, 2022 · 0 comments
Open

I have done small correction in the script #46

abidmaria opened this issue Dec 10, 2022 · 0 comments

Comments

@abidmaria
Copy link

abidmaria commented Dec 10, 2022

I have done small correction on David Bombal's script ( to fetch all the adapters [ if they available] not only the first adapter e.g wlan0 ) below is the correction :

pattern = r'^wlan[0-9]+'
check_wifi_result = subprocess.run(["iwconfig"], capture_output=True).stdout.decode()

wifi_adapters = re.findall(pattern,check_wifi_result,re.MULTILINE)

if len(wifi_adapters) == 0:
print("Please connect a WiFi adapter and try again.")
exit()

print("The following WiFi interfaces are available:")
for index, item in enumerate(wifi_adapters):
print(f"{index} - {item}")

@abidmaria abidmaria changed the title small correction in the script I have done small correction in the script Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant