Все файлы работают на apache сервере в Ubuntu. После отправки формы передайте значения в файл hello.py
<?php
if(isset($_GET["Submit1"]))
{
$target = $_GET["target"];
echo shell_exec("python hello.py $target ");
}
?>
Записать python вывод в файл .CSV. Здесь не создает файл CSV. Эти файлы работают в windows OS. Я не могу найти ошибку здесь.
#!/usr/bin/python3
import csv
import requests
server = sys.argv[1]
r = requests.get("http://" + server)
header = r.headers['Server']
with open('output.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow([header])