Menu

[r29]: / trunk / python / python-interface.php  Maximize  Restore  History

Download this file

44 lines (35 with data), 623 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
function python_print($a) {
if (is_object($a)) {
$n=$a->name;global ${$n};echo ${$n};
} else {
echo $a;
}
}
function python_command($cmd,$parms) {
switch($cmd) {
case "print": echo $parms; break;
}
}
function python_for() {
echo "START-FOR";
}
function python_for_end() {
echo "END-FOR";
}
function python_assign($a,$b,$c) {
if ($b=="=") {
if (is_object($a)) {
if (is_object($c)) {
} else {
$n=$a->name;global ${$n};${$n}=$c;
}
}
}
}
function python_list($v) {
echo "List: ";
var_dump($v);
return 1;
}
function python_mod($a,$b){return is_integer($a)?$a%$b:$a;}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.