From ae5349aabae2ab5adf63339621622f68af4932ad Mon Sep 17 00:00:00 2001 From: Alfonso Corretti Date: Sat, 25 Jan 2025 21:06:31 +0100 Subject: [PATCH] Cross-platform directory separator usage --- dymo_bluetooth/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dymo_bluetooth/__main__.py b/dymo_bluetooth/__main__.py index ea36a1d..e71194f 100644 --- a/dymo_bluetooth/__main__.py +++ b/dymo_bluetooth/__main__.py @@ -26,6 +26,7 @@ from typing import cast from dymo_bluetooth.bluetooth import discover_printers, create_image import sys import asyncio +import os async def print_image( input_file : Path, @@ -46,7 +47,7 @@ async def print_image( def main(): - module_name = cast(str, sys.modules[__name__].__file__).split("/")[-2] + module_name = cast(str, sys.modules[__name__].__file__).split(os.sep)[-2] args = ArgumentParser( prog = f"python -m {module_name}", description = ( @@ -75,4 +76,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main()