<?php
require_once("config.php");
require_once("phpython.lib.php");
$url = parse_url($_SERVER["REQUEST_URI"]);
$url["script"] = $url["path"];
$url["script"] = dirname(__FILE__)."/www/".substr($url["script"],strlen(__BASEPATH__));
$url["script"] = substr($url["script"],-1)=="/" ? $url["script"]."index.py" : $url["script"];
$url["script"] = is_dir($url["script"]) ? $url["script"]."/index.py" : $url["script"];
if (file_exists($url["script"])) {
python_exec($url["script"]);
} else {
header('HTTP/1.0 404 Not Found');
echo "<h1>404 Not Found</h1>";
echo "The page that you have requested could not be found.";
exit();
}