From 2c6df911f8b46b99e250a86d80e10b4a8b2d7605 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Mon, 29 Nov 2021 08:55:30 +0100 Subject: [PATCH 1/2] :tada: opens example from command line --- main.py => opencodeblocks/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename main.py => opencodeblocks/__main__.py (84%) diff --git a/main.py b/opencodeblocks/__main__.py similarity index 84% rename from main.py rename to opencodeblocks/__main__.py index 2df8be1e..3845a866 100644 --- a/main.py +++ b/opencodeblocks/__main__.py @@ -5,7 +5,7 @@ import sys import asyncio -if os.name == "nt": # If on windows +if os.name == "nt": # If on windows asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) from qtpy.QtWidgets import QApplication @@ -17,5 +17,7 @@ app = QApplication(sys.argv) app.setStyle('Fusion') wnd = OCBWindow() + if len(sys.argv) > 1: + wnd.createNewMdiChild(sys.argv[1]) wnd.show() sys.exit(app.exec_()) From da5907bb48d822f2e66141d0ad9b44cf213d8b13 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Mon, 29 Nov 2021 21:50:00 +0100 Subject: [PATCH 2/2] :memo: updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 54d58e0a..9164c457 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ pip install -r requirements.txt Run ! ```bash -python ./main.py +python -m opencodeblocks optional_path_to_ipyg ``` ## Contributing