B
bbechdol
Hi everyone. I am starting to learn python and I decided to start with whatI though was a simple script but I guess now. All I want to do is return what current network location I am using on my mac. Every time I run it, it gives me back a 0. I don't know what I am doing wrong so here is my code. Ireally hope some one can help me. This script is unique to MACS btw.
import sys
import subprocess
loc = "scselect"
srn = "scselect SRN"
home = "scselect HOME"
a = subprocess.call(loc, shell=True, stdout=subprocess.PIPE)
b = subprocess.call(srn, shell=True, stdout=subprocess.PIPE)
c = subprocess.call(home, shell=True, stdout=subprocess.PIPE)
print "\n##### NETWORK SELECTION #####"
print "\nYour current location is set to \n%s" (a)
import sys
import subprocess
loc = "scselect"
srn = "scselect SRN"
home = "scselect HOME"
a = subprocess.call(loc, shell=True, stdout=subprocess.PIPE)
b = subprocess.call(srn, shell=True, stdout=subprocess.PIPE)
c = subprocess.call(home, shell=True, stdout=subprocess.PIPE)
print "\n##### NETWORK SELECTION #####"
print "\nYour current location is set to \n%s" (a)