【发布时间】:2014-09-25 14:57:22
【问题描述】:
我是 GWT 的新手,我有一个在 GWT 上开发的应用程序。我需要在服务器端集成一个用 python 开发的程序。使用 python 开发的应用程序必须获取一个 MalLab 文件,然后生成一些格式为 .PNG 的文件。目前我对 python 程序进行了更改,因为它必须将文件放在特定的 URL 上。您的想法是如何在服务器端将 GWT 应用程序与 python 集成?
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')
【问题讨论】:
-
这里的 GWT 没有什么特别之处。只需使用 this 之类的东西。
-
gwt 服务器端没有什么特别之处,您所需要的只是将您的 python 脚本与 java 集成,我为此使用了 jython,您可以在 pythhon 中创建其他服务器,然后调用它直接从 gwt 前端
-
如何做到的:
you could create rest server in pythhon, and call it directlu from gwt frond end请您进一步发展这个想法
标签: java python gwt service daemon