1
0
mirror of https://github.com/RussellChamp/tilde-projects.git synced 2024-06-15 13:16:37 +00:00
tilde-projects/Code/irc/get_users.py

12 lines
330 B
Python
Raw Normal View History

2015-01-02 16:59:08 +00:00
# Return a list of users on this system
def get_users():
# thanks, ~dan!
users = []
with open("/etc/passwd", "r") as f:
for line in f:
if "/bin/bash" in line:
u = line.split(":")[0] # Grab all text before first ':'
users.append(u)
return users