forked from Scorpio-4488/Ethos_Product_Development
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_python.php
More file actions
33 lines (27 loc) · 950 Bytes
/
Copy pathtest_python.php
File metadata and controls
33 lines (27 loc) · 950 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
<?php
// test_python.php - Test connection to Python
echo "<h2>Testing Python Connection</h2>";
// Test command
$command = 'python --version 2>&1';
$output = shell_exec($command);
echo "<p>Python Version: " . $output . "</p>";
// Test if we can run the Python script
$test_command = 'python data_with_input.py predict "2025-09-16 23:56:00" "2025-09-17 02:59:00" "E100011" 2>&1';
$test_output = shell_exec($test_command);
echo "<h3>Python Script Test Output:</h3>";
echo "<pre>" . htmlspecialchars($test_output) . "</pre>";
// Check if model files exist
$model_files = [
'trained_location_model.joblib',
'model_feature_columns.json',
'data_with_input.py'
];
echo "<h3>Required Files:</h3>";
foreach ($model_files as $file) {
if (file_exists($file)) {
echo "<p style='color: green;'>✓ $file exists</p>";
} else {
echo "<p style='color: red;'>✗ $file missing</p>";
}
}
?>