def countchars(name)return len(open(nameread()def test(name)return countlines(name)countchars(nameor pass file object or return dictionary if __name__ ='__main__'print(test('mymod py')python mymod py ( this is where would probably begin to consider using command-line arguments or user input to provide the filename to be countedinstead of hardcoding it in the script (see for more on sys argvand for more on input-and use raw_input instead in )if __name__ ='__main__'print(test(input('enter file name:')if __name__ ='__main__'import sys print(test(sys argv[ ])console (raw_input in xcommand line nested imports here is my solution (file myclient py)from mymod import countlinescountchars print(countlines('mymod py')countchars('mymod py')python myclient py as for the rest of this onemymod' functions are accessible (that isimportablefrom the top level of myclientsince from simply assigns to names in the importer (it works as if mymod' defs appeared in myclientfor exampleanother file can sayimport myclient myclient countlinesfrom myclient import countchars countcharsif myclient used import instead of fromyou' need to use path to get to the functions in mymod through myclientimport myclient myclient mymod countlinesfrom myclient import mymod mymod countcharsin generalyou can define collector modules that import all the names from other modules so they're available in single convenience module the following partial part vmodules and packages