Skip to content

Python package with a single module that replaces the last backslash in a path string with a forward slash.

License

Notifications You must be signed in to change notification settings

philiporlando/replace_last_backslash

Repository files navigation

replace_last_backslash

Python package for replacing the last backslash '\' in a path string with a forward slash '/'. This is a toy project used to explore Python packaging, distribution, and deployment.

Installation

You can install the development version of the replace_last_backslash package from GitHub by following these steps:

  1. Clone the repository or download the source code from GitHub:
git clone https://github.com/your-username/replace_last_backslash.git

Replace your-username with your GitHub username.

  1. Navigate to the cloned or downloaded directory:
cd replace_last_backslash
  1. Install the package and its dependencies with poetry:
poetry install

Usage

Import the replace_last_backslash function from the replace_last_backslash module and use it in your Python scripts as follows:

from replace_last_backslash import replace_last_backslash

path = "C:the\\string\\in\\this\\path\\to\\fix.txt"
modified_path = replace_last_backslash(path)
print(modified_path) # Output: "C:the\\string\\in\\this\\path\\to/fix.txt"

The replace_last_backslash function takes a path string as input and returns the modified path string with the last backslash replaced by a forward slash. If the path does not contain any backslashes, it is returned as is.

License

This project is licensed under the GNU General Public License v3.0.

About

Python package with a single module that replaces the last backslash in a path string with a forward slash.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages