I've a problem recently, that Im not really capable to solve..
Here is a script
!/bin/bash
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
The export will be simply your own IP Address
192.168.2.1
So far so good but then I go in Python and write
str(os.system("./GrabOwnIP.sh"))
I'll get a different output
192.168.2.1
0
I just want a variable thats keeping this information itself but then I write
OWNIP = str(os.system("./GrabOwnIP.sh"))
Then it will just give me
0
I also tried to use the line from the bash script itself in the Python one but the same results occured