Python OS: get uid by username

Viewed 14

My need is pretty simple: I need a reliable way to find a user's uid, knowing his name. os allows me to get the current's uid but I can't find a way to .getuid(${username}).

I could parse /etc/passwd to get the info but I would like an OS agnostic solution. Do you have one?

0 Answers
Related