Запуск файла .py в браузере

Я хочу запустить файл python в браузере. Я установил apache. и настроил файл httd.conf . Я создал файл test.py . Затем я попытался запустить test.py в моем браузере, набрав htt: //localhost/test.py . При этом я получаю следующую ошибку:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, lohith.pinto@primefocusworld.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

В моем журнале ошибок

[Thu Jul 07 18:39:55 2011] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified.  : couldn't create child process: 720002: test.py
[Thu Jul 07 18:39:55 2011] [error] [client 127.0.0.1] (OS 2)The system cannot find the file specified.  : couldn't spawn child process: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/test.py

В чем может быть проблема?

7
задан thegrinner 7 July 2011 в 15:25
поделиться

1 ответ

Во-первых проверьте URL браузера как этот

file:///C:/xampp/htdocs/cgi_python/form.html

, Который является средним, Вы - код, корректно, и никакая ошибка

, Но вывод не показывает кодом сценария Python, потому что "работа кода в консолях не в браузере" т.е. означают, что Вы непосредственно открыты файл в htdocs папке и нажимаете filename.html и выполняетесь затем произведенный от в текстовом формате Для открытого, который Решение для браузера

  1. открытый тип браузера в url
  2. localhost/filepath

, например, , http://localhost/cgi_python/form.html

Затем получает ответ

0
ответ дан 6 December 2019 в 15:07
поделиться
Другие вопросы по тегам:

Похожие вопросы: