Win Call CGI in Webinterface
#1
Is it possible to call CGI script in Webinterface addon?
I plan to reuse Python script in Windows environment, but hard to find related info, such like how to specifying Python path.
Reply
#2
Can you give an example of what you're trying to do?

XBMC contains a full python environment and just adds the XBMC modules to it. Anything you can do in a regular Python environment can be done in XBMC. The only changes are in how you present things to the user
Reply
#3
Here is the plan:

Name of the first addon is 'webinterface.test1'. It has web interface to show some information collected from other website.
But XMLHttpRequest() method is bounded to local, so I will use python script, either cgi style resided in the same directory or another addon, like script.meta.test2.
It will return xml(or json).

I tried to call cgi script in python in web page, but it wasn't recognized as cgi. I tried .py and .cgi extensions but both didn't work.
Reply
#4
Ahhh ok, so you want to host and serve a cgi script from within xbmc. I thought you wanted to execute a cgi script which is hosted by another, standalone, server.

It can still be done, but you would need to package up a whole web server. There is almost certainly a better way. Depending on what you're trying to do, the most straight forward solution is probably to implement it in Javascript which is executed on the client side, whereas cgi is executed on the server side (which wouldn't require you to implement a python webserver)
Reply
#5
Thanks Bstrdsmkr. The python code is a part of python webserver already. I wonder if there is a way I can handle within xbmc environment.
Reply
#6
If it's part of python 2.7 standard packages, it should be available and work just the same within xbmc
Reply

Logout Mark Read Team Forum Stats Members Help
Call CGI in Webinterface0