I have written a module in python which performs some function.
I then created a Google Chrome extension which makes use of JSON and javascript.
Now when I click on the extension I want it to execute the python program which is stored on my hard disk and display the output on the browser again.
Is there a way in which I can do this??
-
1Is the point of the extension to use chrome? Or are you just looking for an environment for your application? I am doing something quite similar using the Adobe Air SDK, which lets you call python scripts bundled with your app. It is a javascript / html environment which allows you to work with you local hard disk and local sockets / resources.Tom Gruner– Tom Gruner2011年03月16日 15:26:51 +00:00Commented Mar 16, 2011 at 15:26
-
But I want it to be made available on the browser. Adobe Air SDK lets you create an interface on the browser?Apps– Apps2011年03月16日 15:41:07 +00:00Commented Mar 16, 2011 at 15:41
-
No, it won't allow you to make it avaiable in another browser. It has it's own internal webkit based browser, which is installed as an air app or native application.Tom Gruner– Tom Gruner2011年03月16日 15:55:48 +00:00Commented Mar 16, 2011 at 15:55
-
I have already created the plug in.. I just want to send data from the current web page to my python program residing on my hard disk . Is there a way I can do that?Apps– Apps2011年03月16日 16:00:08 +00:00Commented Mar 16, 2011 at 16:00
-
No experience with chrome extensions, so can't help there unfortunately.Tom Gruner– Tom Gruner2011年03月16日 16:03:05 +00:00Commented Mar 16, 2011 at 16:03
3 Answers 3
Repeated :
Calling Python from JavaScript
Here you have some answers, Pyjamas is probably the best option in your case
2 Comments
Probably a late reply but a possible solution is to make your python script act as a server and let the browser plugin interact with it.
Comments
forgive me if i'm incorrect on infinite proportions.
I believe that JavaScript is executed in a sandboxed/ isolated environment. Therefore you cannot invoke a python interpreter* or any other executable residing on the system.
*unless the interpreter itself were written in javascript.