From 7581e4291f2e6ae2e8494a2b671aae22f128dfdf Mon Sep 17 00:00:00 2001 From: hantianfeng Date: Mon, 9 Sep 2024 20:03:17 +0800 Subject: [PATCH] Update readme and examples --- README.md | 9 +++------ examples/{lib => crash}/thread.php | 0 examples/tqdm.php | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) rename examples/{lib => crash}/thread.php (100%) create mode 100644 examples/tqdm.php diff --git a/README.md b/README.md index 2566005..3da6daf 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,9 @@ A library for inter-calling `Python` and `PHP`. You can use Python functions and libraries in PHP, or use PHP packages in Python. -> See documents: [docs/en/README.md](docs/en/README.md) - - - -> Supports Linux/Windows/macOS -> Not support Python multithreading or async-io features +- See documents: [docs/en/README.md](docs/en/README.md) +- Supports `Linux`/`Windows`/`macOS` +- **Not support Python `threading` or `async-io` features** ## py2php [py2php](https://swoole.com/py2php/) is online utility that will auto-translate python code into PHP code. diff --git a/examples/lib/thread.php b/examples/crash/thread.php similarity index 100% rename from examples/lib/thread.php rename to examples/crash/thread.php diff --git a/examples/tqdm.php b/examples/tqdm.php new file mode 100644 index 0000000..7d69af4 --- /dev/null +++ b/examples/tqdm.php @@ -0,0 +1,14 @@ +tqdm; + +$pbar = $tqdm(total: 100); + +foreach (range(1, 100) as $current) { + usleep(1000 * random_int(1, 100)); + $pbar->update(1); +} +$pbar->close(); +