0bmxa / why-no-network

WHY NO NETWORK
0 stars 0 forks source link

Would converting these half bash / half python functions to just bash be useful? #4

Open zconnelly13 opened 6 years ago

zconnelly13 commented 6 years ago

For instance...

def get_ipv4():
    return subprocess.getoutput("ifconfig en0 | grep 'inet[^6]' | cut -d ' ' -f 2")

This puts it more in bash world and less in python -- but the python requires a knowledge of how to parse the output of these commands just like the bash would.

This is also a bit more brief and does nearly the exact same thing (but again requires more knowledge of bash than python)

/shrug

0bmxa commented 6 years ago

My initial idea was to have them in Python only, but I didn’t know how to get certain information in Python, so I temporarily solved these with bash. Also, I find the Python way a lot more readable (hashtag self documenting code).

zconnelly13 commented 6 years ago

Ahhhh okay so we need to do the exact opposite in fact, haha, gotcha

Max notifications@github.com schrieb am Sa. 12. Mai 2018 um 19:35:

My initial idea was to have them in Python only, but I didn’t know how to get certain information in Python, so I temporarily solved these with bash. Also, I find the Python way a lot more readable (hashtag self documenting code).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/0bmxa/why-no-network/issues/4#issuecomment-388570920, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHfewq8jDxZsILCJ7eylCiWF5-zU07Uks5txx1ygaJpZM4T8dVG .