PiP - PythonをPHPコードの中に埋め込む
2005年11月15日-
スポンサード リンク
PiP - Python in PHP
Perl版があったら日本でもウケそうです。
To that end, I've written a Python extension for PHP. In short, this extensions allows the Python interpretter to be embedded inside of PHP (think of PHP as the parent language with Python as its child). This allows native Python objects to be instantiated and manipulated from within PHP. There is also initial support for accessing PHP functions and data from within the embedded Python environment.PHPのエクステンションとしてPythonインタプリタを埋め込んでみました。というものです。
<?phppy_evalでPythonのコードを評価し、実行できる。すごいです。
$a = "test";
$b = true;
$c = 50;
$d = 60.4;
$code = <<<EOD
import php
a = php.var('a')
b = php.var('b')
c = php.var('c')
d = php.var('d')
print a, b, c, d
print a, d / c + b, a
EOD;
py_eval($code);
?>
Perl版があったら日本でもウケそうです。
スポンサード リンク
Advertisements
SITE PROFILE
最新のブログ記事(新着順)
- 15000以上のいい感じの線形アイコン「Lineicons」
- CSSやTailwindでのCSSスニペットライブラリ「CSS Snippets Library」
- AIを使ってサイトマップが作れる「Octopus.do」
- ライブラリ依存のないモーダルオープンライブラリ「Blendy」
- 個性的な明朝フリーフォント「築豊初号明朝OFL」
- CSSで太陽が差し込むようなアニメーション実装
- 可愛くアニメーションする「beautifully crafted animated icons」
- アイソメトリックなアイコンがアイコンがPNG,SVGでゲットできる「Isoicons」
- ユニークなカタカナフォントtorisippo
- 美しいメッシュグラデーションをCSSで簡単に取得できる「MSHR」
- 過去のエントリ