diff --git a/pydash/services.py b/pydash/services.py index 9e1b276..7a9f40c 100644 --- a/pydash/services.py +++ b/pydash/services.py @@ -72,25 +72,13 @@ def get_cpus(): cpu_info = cpuinfo.get_cpu_info() _cpu_info = {"cpus":cpu_info["count"],"type": cpu_info["brand"]} return _cpu_info - + +# win comp def get_users(): """ Get the current logged in users """ - try: - pipe = os.popen("who |" + "awk '{print $1, $2, $6}'") - data = pipe.read().strip().split('\n') - pipe.close() - - if data == [""]: - data = None - else: - data = [i.split(None, 3) for i in data] - - except Exception as err: - data = str(err) - - return data + return [[user.name,user.terminal,user.host] for user in psutil.users()] def get_traffic(request):