User Tools

Site Tools


python_directory_search

import os

config_files=[]
webserver_config="/etc/httpd/conf.d/"

for root, dirs, files in os.walk(webserver_config):
    for file in files:
        if file.endswith(".conf"):
             config_files.append(os.path.join(root, file))
for print_config in config_files: print print_config

python_directory_search.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki