#! /usr/bin/env python3 # def hw9 ( ): #*****************************************************************************80 # ## hw9 simply prints some information about a user. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 07 November 2019 # # Author: # # John Burkardt # print ( '' ) print ( 'hw9:' ) print ( ' Run this program with the command' ) print ( ' python hw9.py > hw9.txt' ) print ( ' and send the file "hw9.txt" to your instructor.' ) import getpass username = getpass.getuser ( ) print ( '' ) print ( 'My name is', username ) import time localtime = time.asctime ( time.localtime ( time.time ( ) ) ) print ( '' ) print ( 'The time is', localtime ) import socket host = socket.gethostname ( ) print ( '' ) print ( 'I am logged in on', host ) import os files = os.listdir ( "." ) print ( '' ) print ( 'My files include', files ) print ( '' ) print ( 'hw9:' ) print ( ' Normal end of execution.' ) return if ( __name__ == '__main__' ): hw9 ( )