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
最新のブログ記事(新着順)
- 2012年5月23日 管理人のブックマーク
- PC・スマホ・タブレットで動くクールなHTML5スライドショー実装ができる「Juicebox」
- 既にここまで出来るWebGLのデモ22
- 2012年5月22日 管理人のブックマーク
- CSSな吹き出しを作れるWEBツール「cssarrowplease」
- PHP+Bootstrapで書かれた美しいGitリポジトリビューア「GitList」
- 2012年5月21日 管理人のブックマーク
- CSS3で描かれたシェイプのサンプル集
- これは新しい!クールなタイル状の年間カレンダー実装jQueryプラグイン「jQuery Verbose Calendar」
- 2012年5月18日 管理人のブックマーク
- 過去のエントリ



















間違いの指摘をしていただける方はメール、あるいはTwitter/FBでお願いします(クリック)



