1

First of all, I am electrical engineer, but I want to create the following system; I want that applications in many distributed computers (clients) can be able to send data to a python calculation framework through a server.

Time ago I wrote a client/server program in JAVA and it was more or less straight forward, but now I need a calculation core where students can program their calculation modules, and python seems simple enough to not to make people hate programming.

enter image description here

The question is, can the server be programmed in python, blending the python calculation core with the server of data, while the clients are made in Java or .Net or whatever?

I hope this is clear enough, since I have very little experience in web service programming. Also a good tutorial or starting point would be nice.

4 Answers 4

1

When building a web application the options for client-side technology are limited: Mainly JavaScript (or a VM like Flash or Java). The inventors of node.js tout this as a major selling point: Now you can build your web server and web client entirely in Javascript.

But the rest of the web gets on fine without using node.js, eg. using frameworks like Ruby on Rails, or Python, or Java or .NET. Communication with the client is typically done using JSON data and serving a clean API (Application Programming Interface) with which the client can fetch/receieve data.

Beyond web clients, there are plenty of examples of communication protocols which solve the problem you are describing, allowing components of different languages/platforms to work together:

1
1

Of course it's possible, and actually quite common.

Examples:

  • Web browser (a generic client) is programmed C++ (Firefox, Chrome) while web applications are programmed in pleathora of programming languages.
  • Mobile applications are programmed in Objective-C (iOS) or Java (Android), while backend services are programmed in Java, .NET, Python, Ruby, JavaScript, Go and gazillion others.
1

Yes you can make different langages communicate through sockets ! You have different way to accomplish this:

  • Use a format like XML, JSON or protocol buffer libraries supported by both langages.
  • Send raw data or text and create your own protocol.

Fundamentally, what goes through a socket is byte data, and bytes are the same in any language. The main problem is that you will have to re-implement the logic for each side and for each language you use.

For your case i think the best way to do it is to use Google protocol buffer which is supported by Python Java and C#: have a look: Protocol buffer tutorial in python and Protocol buffer tutorial in Java and even in C# Protocol buffer tutorial in C#

0

There is no reason why that shouldn't work. Currently the internet is build of computers using all different kind of programs build by numerous programming languages.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.