12 ответов
+ 3
Avoiding using subprocess if possible is always wise. At the very least it will mean the code is more likely to be platform independent, but it's also easy to inadvertently create security problems that way (if the program is accessible by other users and if they can send arbitrary data to that program).
Oh, there is another option, but it's massively overkill and should not be needed. Still, in the interests of complete answers, it's always possible to create bindings to any C or C++ code in CPython with either ctypes, CFFI, SWIG or other similar tools.
+ 5
And? Did the subprocess work out?
+ 3
Thank you bery much!!! I may have found a way, using subprocess and executing bash commands through it
+ 2
It is difficult to answer to your question without experience, but I think these 2 frameworks may have something for you:
kivy: network
PyQt5: QtBluetooth, QtNetwork
+ 2
Yep worked like a charm. Check my profile for the code if you want too
+ 2
I ll post a code for obtaining a way to find fhe network you are conmected to using ifconfig and passing through grep the result, but imo it is not a very reliable way to find the network you are connected (via ifconfig)
+ 2
I use Windows and for see the other ip and mac in the network i use The command prompt with The command "arp -a". I think that this command work on bash
+ 1
Thank you very much!!! This period, im experimenting with python and bash, so im totally new to this, and i havent still learned c. when im more experienced i will try to find multiple ways for these kind of problems, learning how the computer works in general
0
From the standard library, look at the asyncio, socket and ipaddress modules.
In addition to that, also look at Twisted and the aio-libs.
0
thanks!!! If there is a way without subporcess that might be better
0
I have uploaded a script that finds out the wireless interfaces that are connected to the internet(if there are multiple) with their names added to a list, so they can be used to other scripts.
0
covers all the possible outcomes, 0 or more interfaces. regex is sooo good!!!