-
-
Notifications
You must be signed in to change notification settings - Fork 0
file
XulbuX edited this page Sep 15, 2025
·
3 revisions
This class includes methods to work with files and file paths.
This method will rename the extension of the given file.
Params:
-
file: strthe path to the file -
new_extension: strthe new extension of the file -
full_extension: bool = Falsewhether to rename the full extension (e.g..tar.gz) or just the last part (e.g..gz) -
camel_case_filename: bool = Falsewhether to additionally make the filename CamelCase
Returns: no return value
This method will create a file with ot without content.
Params:
-
file: strthe path for the new file with file extension -
content: str = ""the content of the created file -
force: bool = Falsewhether to overwrite the file if it already exists
Returns: the full filepath of the newly created file
Raises:
-
FileExistsErrorif a file already with the same filename already exists (andforceis false) -
SameContentFileExistsErrorif a file with the same filename and same content already exists (andforceis false)
★⠀Python Library by XulbuX⠀★
-
Intended Audience:
- Developers
-
License:
- OSI Approved
- MIT License
-
Operating Systems:
- Full Library: OS Independent
-
Supported Python Versions:
- Python 3.13
- Python 3.12
- Python 3.11
- Python 3.10
-
Topics:
- Libraries
- Python Modules
- Software Development