简体   繁体   English

服务器端的GWT和python

[英]GWT and python on the server side

I'm new on GWT and i have an application developed on GWT. 我是GWT的新手,我有一个在GWT上开发的应用程序。 I need integrates a program on the server side that was developed with python. 我需要在服务器端集成一个用python开发的程序。 The application developed with python must take a MalLab file and then produce some files on format .PNG. 使用python开发的应用程序必须获取MalLab文件,然后生成.PNG格式的文件。 For the moment i made changes on the python program, because it must take the file on an specific URL. 目前,我在python程序上进行了更改,因为它必须将文件放在特定的URL上。 How you one idea for integrates a GWT application with python on the server side?. 您如何在服务器端将GWT应用程序与python集成?

The program in python is: python中的程序是:

#!/usr/bin/python
# -*- coding: utf-8 -*-
import scipy.io
import pylab as pl
import numpy as np
from scipy import misc
from glob import glob

# import file into a dictionary
fMatLab = scipy.io.loadmat('St3D', mat_dtype = True, squeeze_me = True, struct_as_record=False)

# read in the structure
data = fMatLab['St3D']

for i in range(data.shape[2]):
    misc.imsave('transect_%s.png' % i, data[:,:,i] )
    img = scipy.misc.toimage(data[:,:,i], mode='I')

All you need to do on the RemoteServlet is write few lines of java code to execute your script 您在RemoteServlet上需要做的就是编写几行Java代码来执行脚本

String[] cmd = {
    "/bin/bash",
    "-c",
    "python script.py \"" + path_to_matlab_file + "\""
};
Runtime.getRuntime().exec(cmd);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM