Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 831 Bytes

composer.md

File metadata and controls

36 lines (25 loc) · 831 Bytes

IDE Auto Completion

phpy provides a tool for generating IDE auto completion files. Here is how to use it:

cd phpy/tools
php gen-lib.php [Python package name]

For example, matplotlib.pyplot:

  • Import directly: PyCore::import('matplotlib.pyplot')
  • Generate completion file: php tools/gen-lib.php matplotlib.pyplot

You can also configure tools/gen-all-lib.php to generate completion files for multiple packages at once.

How to use

Install dependency files

composer require swoole/phpy

Use the auto completion

require dirname(__DIR__, 2) . '/vendor/autoload.php';
$plt = python\matplotlib\pyplot::import();

$x = new PyList([1, 2, 3, 4]);
$y = new PyList([30, 20, 50, 60]);
$plt->plot($x, $y);
$plt->show();

IDE Auto Completion