我有下面的python脚本。在
import mysql.connector
cnx = mysql.connector.connect(user='root', password = 'signal', host = '127.0.0.1', port = '1928'
,
database = 's_events')
cursor = cnx.cursor()
insert_stmt = "INSERT INTO t_events (eid) VALUES ('iosevent123')"
data = 'iosevent123'
cursor.execute(insert_stmt)
cnx.commit()
cnx.close()
我还启动了python提供的simplehttpserver。在
如何调用上面的脚本以便将数据插入表中?在
以this example为灵感,通过执行python脚本[免责声明:未测试]在某些计算机上运行服务器
一旦运行,只需从IOS应用程序向启动的服务器发送get请求。(我引用“简单”是因为我没有使用过IOS,但我认为pingapi是很常见的。)
相关问题 更多 >
编程相关推荐