This project provides a simple Python script to convert images into a single PDF file while maintaining the order of the images based on their filenames.
- Python 3.x
- Pillow library
-
Clone the repository (if applicable):
git clone <repository-url> cd <repository-name>
=======================================
This document provides step-by-step instructions on how to create and use a Python virtual environment (venv).
A virtual environment is an isolated environment in which you can install packages separately from the system-wide Python installation. This helps manage dependencies for different projects without conflicts.
-
Open your terminal or command prompt.
-
Navigate to your project directory:
cd path/to/your/project
-
Create a virtual environment:
Run the following command:
python -m venv venv
This creates a new directory named
venv
in your project folder, containing the virtual environment.
To activate the virtual environment, use the following commands:
-
On Windows:
venv\Scripts\activate
-
On macOS/Linux:
source venv/bin/activate
Once activated, your command prompt should change to indicate that you are now working within the virtual environment (e.g., it might show (venv)
at the beginning of the line).
While the virtual environment is activated, you can install packages using pip
. For example, to install Pillow
, run:
pip install Pillow
To install multiple packages from a requirements.txt
file:
pip install -r requirements.txt
When you are done working in the virtual environment, you can deactivate it by running:
deactivate
Your command prompt will return to normal, indicating that you are no longer in the virtual environment.
cd path/to/your/project
python -m venv venv
# Activate
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install packages
pip install Pillow
# Deactivate
deactivate
By following these instructions, you can easily manage your Python projects using virtual environments.