Skip to content

Commit

Permalink
Use Popen with individual args instead of a shell command.
Browse files Browse the repository at this point in the history
  • Loading branch information
akkana committed Jan 21, 2015
1 parent a5ed9b2 commit 2e8fb4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions netutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,14 @@ def get_accesspoints() :
print "Is the interface's driver loaded?"
return None

proc = subprocess.Popen('iwlist scan 2>/dev/null',
shell=True, stdout=subprocess.PIPE)
# proc = subprocess.Popen('iwlist scan 2>/dev/null',
# shell=True, stdout=subprocess.PIPE)
proc = subprocess.Popen(['iwlist', 'scan'],
shell=False, stdout=subprocess.PIPE)
#proc = subprocess.Popen('cat /home/akkana/iwlist.out 2>/dev/null',
# shell=True, stdout=subprocess.PIPE, )
stdout_str = proc.communicate()[0]
# print "iwlist said:\n" + stdout_str
stdout_list = stdout_str.split('\n')

iface = None
Expand Down

0 comments on commit 2e8fb4d

Please sign in to comment.