From 07b7ca5e6da5d9d09bd046769dc6500eb5a737c8 Mon Sep 17 00:00:00 2001 From: matyhtf Date: Wed, 27 Nov 2024 17:52:59 +0800 Subject: [PATCH] Added example for import a user-defined Python module --- examples/import/fun.py | 3 +++ examples/import/test.php | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 examples/import/fun.py create mode 100644 examples/import/test.php diff --git a/examples/import/fun.py b/examples/import/fun.py new file mode 100644 index 0000000..89bf165 --- /dev/null +++ b/examples/import/fun.py @@ -0,0 +1,3 @@ +def test(): + print("hello world!") + diff --git a/examples/import/test.php b/examples/import/test.php new file mode 100644 index 0000000..e3479e4 --- /dev/null +++ b/examples/import/test.php @@ -0,0 +1,8 @@ +path->append(__DIR__); + +$fun = PyCore::import('fun'); +$fun->test(); +