大丈夫です... pythonプログラムの出力はTkinterウィンドウに表示され、別々に開きます。私がしたいことは、ブラウザ内にこのウィンドウを埋め込むことです。コードは次のとおりです。python tkinterウィンドウをブラウザに埋め込む方法は?
import numpy as np
import matplotlib
import matplotlib.cbook as cbook
import matplotlib.image as image
import matplotlib.pyplot as plt
datafile = cbook.get_sample_data('logo2.png', asfileobj=False)
print 'loading', datafile
im = image.imread(datafile)
im[:,:,-1] = 0.5 # set the alpha channel
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
ax.grid()
fig.figimage(im, 10, 10)
plt.show()
すべての変数は、ブラウザのフォームフィールドから与えられる入力パラメータです。助けてください!! :-)
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-serverおよびhttp://stackoverflow.com/questions/5515278/plot-matplotlib-on-the -webが役に立つかもしれません。少し役に立ちました – Ken
、感謝ken。しかし、私が正確に必要とするのは、tkinter(デフォルトでは来る)のインタラクティブな機能です。どうやってやるの? :-) – khan
あなたが必要とするものは、ブラウザで動作する(標準)バックエンドです。私はそのようなバックエンドを知らないが、私はtKinterがその1つであることを期待していないだろう... –