0

I want to make a very simplistic graphical interface that will allow the user to enter a few bits of information into a form and then I will crunch the data and spit out a google map to the web page the user is interfacing with.

However, this will just run on a local machine instead of being a webpage that is served to the user. I would like to do the "data crunching" in python so I would like the javascript to be able to pass the form data to a python function and then do some stuff and then output back to the webpage.

Is there a good way to do this? Any suggestions? I just want to have a web form as the frontend because this seems the easiest, but I am open to suggestions.

2 Answers 2

2

Please note http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=v8&lang2=python . Python is slower than javascript; most javascript engines are very quick.

Sign up to request clarification or add additional context in comments.

4 Comments

By Most you mean only IE9 / FF4 / Chrome10+ / Saf5 / Opera11+
@Raynos: Those are browsers, not JavaScript Engines. ;)
@Shaz and If I said Chakra / JaegerMonkey / Crankshaft / Nitro / Carakan most people would be lost.
@Raynos: Carkan! That JaegerMonkey Nitroed my Crankshaft using his own Chakra!
0

If you want to use python on a local machine you will depend on the client having it, and not only that, you would have to check their current version and work twice to make it work for both 2.X and 3.X.

I would do as mozillanerd said, and work only with javascript.

If you love python I can't see a way better to do this that using python on your server, using something like python-shell (for node.js):

var PythonShell = require('python-shell');

var options = {
  args: [latitude, longitude]
};

PythonShell.run('my_script.py', options, function (err, results) {
  if (err) throw err;
  console.log('results: %j', results);
});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.