import os
import ctypes
from subprocess import PIPE, Popen
def ecmd(command):
    obj = Popen(command, shell = True, stdout = PIPE, stderr = PIPE)
    out= obj.communicate()[0]
    if out=='':
        print "No network shares"
    else:
        print out
ecmd("net share")