Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wintersolid/py_keysearch


https://github.com/wintersolid/py_keysearch

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Py_KeySearch

## About
This code defines a function search_keywords_in_files that searches for a set of keywords in all files within a specified directory.
It returns a list of tuples containing the filename, line number, and line content where each keyword is found.

## To use this code
- replace '/path/to/your/files' with the directory containing the files you want to search in, and {'keyword1', 'keyword2', 'keyword3'} with the set of keywords you want to search for.

When you run this script, it will print out each occurrence of the keywords along with the filename and line number where they were found.

## To run the search_keywords_in_files script, you need to follow these steps:

- Save the Script: First, save the Python script containing the search_keywords_in_files function to a file
Navigate to the Directory Containing Your Script: Open a Terminal or Command Prompt and navigate to the directory containing keyword_search.py using the cd command.
Run the Script: Once you're in the correct directory, you can run the Python script by typing:

>> python keyword_search.py