# python 2 or 3, linux only
# AUTHOR: Gribouillis for the python forum at www.daniweb.com
import grp
import os
import pwd

if pwd.getpwuid(os.getuid()).pw_name in grp.getgrnam('www-data').gr_mem:
	print("current user is a member of group www-data")
2
Contributors
1
Reply
79
Views
3 Years
Discussion Span
Last Post by golamkibria
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.