Code Example:
import socket, getpass, os # Get the current system hostname host_name = socket.gethostname () # Get the current system user name USER_NAME = getpass.getuser () # Get the current system user directory USER_HOME = os.path.expanduser ( ' ~ ' ) Print ( ' host name -> S% ' % host_name) Print ( ' User name -> S% ' % USER_NAME) Print ( ' User Directory -> S% ' % USER_HOME)