This repository contains a collection of Python scripts designed for various automation and utility tasks such as killing processes and merging file contents. These scripts are designed to be cross-platform and can be used on Linux, macOS, and Windows.
This script allows users to kill processes by name on any operating system.
- Python 3.6 or higher
psutil
module
Execute the script by providing the name of the process you want to terminate:
python kill_named_process.py <ProcessName>
Concatenates the contents of files with specified extensions from the current directory and all its subdirectories, prefixing each file's content with its relative path. The combined contents are then copied to the clipboard.
- Python 3.6 or higher
pyperclip
module
Execute the script with optional arguments for file extensions to include or ignore:
python merge_files.py --extensions txt py --ignore json log
-
Ensure Python and pip are installed on your system.
-
Clone this repository or download the scripts you are interested in.
-
Install required Python modules via pip:
pip install pyperclip psutil
- Set Python as the default program for
.py
files: Right-click on any.py
file, select 'Open with' > 'Choose another app', find your Python executable, and set it as the default. - Add Python Scripts to the Windows PATH: This allows running your Python scripts from anywhere in Command Prompt or Windows Explorer. Add your script directory to the 'Path' variable in 'Environment Variables'.
After setting up your Python environment, directly execute the scripts from any directory:
python <script_name.py> <arguments>
Ensure scripts are executable:
chmod +x <script_name.py>
Run scripts from the terminal:
./<script_name.py> <arguments>
Download and run scripts only from trusted sources. Unverified scripts can pose a security risk.
- Script does not run: Verify Python installation and module presence.
- Unexpected script output: Ensure correct script usage and arguments.
- Clipboard issues: Check for large data or matching specified extensions.
For further assistance, refer to the official Python documentation or the documentation of the used modules.