虽然我可以看到许多对类似问题的回应,但我并不真的认为他们回答了我的问题。基本上,我有一个python cgi脚本,我想运行另一个脚本。例如,为了简单起见,假设我想执行以下操作:
#!/usr/bin/env python3
print("html_text)
# here call some other Python cgi script which has some other HTML text
我只是想简化这个问题,这样答案就可以集中在我真正想要理解的东西上。基本上,我想从我当前的python cgi脚本中调用另一个Python cgi脚本,以便它打印更多的html (并可能
我有一个Python脚本,当POST请求发送到时,应该将一些数据加载到postgres中。在脚本中,使用系统用户(dbuser)连接到数据库(对于psql很好)。但是,当在Apache中执行脚本时,脚本无法连接,返回以下错误:
Peer authentication failed for user dbuser
是否有一种方式允许脚本连接而不提供用户密码?
在本地网络中有一个网站。我想编写一个bash脚本,它将从本地网站下载HTML并将其发送到外部服务器,在该服务器中,PHP脚本可以从$_POST读取它。
html=$(wget --post-data="str=data" -qO- http://192.168.1.8/reg/index.php)
#so far so good, and $html contains data I want to send to my website
wget --post-data="html=$html" -qO- http://mywebsite.com/test.php
我什么都试过了,但这条路似乎行不通。我是新来的酒瓶,我正在当地运行它。此外,由于路径似乎不存在,我的角js代码在将数据发送到烧瓶时给出了404。
app.py
@app.route('/')
@app.route('/index')
def IndexPage():
return render_template('index.html')
#these routes don't work although all of the others do which is very confusing
@app.route('/
日安。谁能帮帮我。我的任务是创建一个python脚本(客户端),将图像发送到php (服务器端)。
注意: python脚本在不同的raspberry pi中运行,php服务器只能通过互联网接收图像。
成就:我现在可以将文本数据从客户端发送到服务器。
问题:我最大的问题是如何发送图像?
任何意见和建议都是非常感谢的。谢谢。
我的Python脚本:
import urllib2
from urllib import urlencode
# 192.168.5.149 is the ip address of server
url = "http://192.168.5.149/ser