我有一個python腳本,它使GUI。當按鈕「運行」在該GUI被按下它運行從導入的包(我製造)這樣如何添加多個文件到py2app?
from predictmiP import predictor
class MiPFrame(wx.Frame):
[...]
def runmiP(self, event):
predictor.runPrediction(self.uploadProtInterestField.GetValue(), self.uploadAllProteinsField.GetValue(), self.uploadPfamTextField.GetValue(), \
self.edit_eval_all.Value, self.edit_eval_small.Value, self.saveOutputField)
的函數當我從蟒直接運行的GUI這一切工作良好,程序寫入的輸出文件。但是,當我將它製作成應用程序時,GUI會啓動,但是當我按下按鈕時,什麼也沒有發生。與我正在使用的所有其他導入一樣,predictmiP確實包含在build/bdist.macosx-10.3-fat/python2.7-standalone/app/collect /中(儘管它是空的,但與所有其他導入一樣我有)。
如何獲得多個python文件或導入的包與py2app一起使用?
我setup.py:
「」 「 這是py2applet
用法產生一個setup.py腳本: 蟒蛇setup.py py2app 」「」
from setuptools import setup
APP = ['mip3.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
編輯:
它看起來編輯喜歡它的工作,但它只適用於一點點。從我的GUI我打電話
blast.makeBLASTdb(self.uploadAllProteinsField.GetValue(), 'allDB')
# to test if it's working
dlg = wx.MessageDialog(self, "werkt"+self.saveOutputField, "werkt", wx.OK)
dlg.ShowModal() # Show it
dlg.Destroy() # finally destroy it when finished.
blast.makeBLASTdb看起來是這樣的:
def makeBLASTdb(proteins_file, database_name):
subprocess.call(['/.'+os.path.realpath(__file__).rstrip(__file__.split('/')[-1])+'blast/makeblastdb', '-in', proteins_file, '-dbtype', 'prot', '-out', database_name])
這個函數被調用,makeblastdb我通過調用子確實輸出的文件。然而,程序不會繼續,
dlg = wx.MessageDialog(self, "werkt"+self.saveOutputField, "werkt", wx.OK)
dlg.ShowModal() # Show it
在接下來的行永遠不會被執行。
你的setup.py在哪裏?這個預測模塊/包是什麼?純Python還是什麼? – mmgp
它是純Python。我將編輯我的問題以包含我的setup.py –
將問題簡化爲一個獨立的示例,以獲得更準確的幫助。 – mmgp