GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python_Scripting_documents/4.1.Document-without_oops.py at master · surendra1453/Python_Scripting_documents Expand file tree/ Copy path4.1.Document-without_oops.pyMore file actions 34 lines (30 loc) · 1.02 KB / Copy path4.1.Document-without_oops.pyFile metadata and controls34 lines (30 loc) · 1.02 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #!/bin/python3 import os def get_all_tomcats(): list_of_config_files=[] for r,d,f in os.walk("/"): for each_file in f: if each_file=='server.xml': list_of_config_files.append(os.path.join(r,each_file)) return list_of_config_files def display_details(home_cnf_files): for each_key in home_cnf_files.keys(): print(f'The Tomcat home is: {home_cnf_files[each_key][0]}') print(f'The Tomcat config file is:{home_cnf_files[each_key][1]}' ) return None def main(): print("Finding list of tomcats...") list_of_tomcats=get_all_tomcats() #print(list_of_tomcats) cnt=1 home_cnf_files={} for each_config_file in list_of_tomcats: t_home=os.path.dirname(os.path.dirname(each_config_file)) t_cnf_file=each_config_file home_cnf_files['tomcat'+str(cnt)]=[t_home,t_cnf_file] cnt+=1 #print(home_cnf_files) display_details(home_cnf_files) return None if __name__ == '__main__': main() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |