Skip to content

Commit

Permalink
Update readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 9, 2024
1 parent a503a7e commit 7581e42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions examples/tqdm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$operator = PyCore::import("operator");
$builtins = PyCore::import("builtins");
$tqdm = PyCore::import('tqdm')->tqdm;

$pbar = $tqdm(total: 100);

foreach (range(1, 100) as $current) {
usleep(1000 * random_int(1, 100));
$pbar->update(1);
}
$pbar->close();

0 comments on commit 7581e42

Please sign in to comment.