Is current user member of group www-data ?
# 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")
golamkibria 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.