在html/php中执行.py

发布于 2025-01-24 19:07:14 字数 179 浏览 3 评论 0 原文

我写了一个Python脚本,将其输出写入TXT文件。 然后,我将该文件包含在我的HTML/PHP网站中。 - 到目前为止效果很好。 仅剩下的问题:打开站点时我无法自动执行.py文件。 我知道这不是最好的解决方案 <?php exec(“ python3 auswertung.py”); ?> 似乎不起作用

I wrote a Python script which writes its output into a txt file.
Then I included that file in my html/php website. - works good so far.
Only remaining problem: I can't execute the .py file automatically while opening the site.
I know that this isn't the best solution
<?PHP exec("python3 Auswertung.py"); ?> doesn't seem to work

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原来是傀儡 2025-01-31 19:07:14

我使用命令 chown -r www -data:www -data&lt; directory&gt; chmod -r 755&lt;目录&gt; 。我不确定哪个命令解决了我的问题,但至少它的工作正常。

I used the commands chown -R www-data:www-data <directory> and chmod -R 755 <directory>. I'm not sure which command solved my problem, but at least its working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文