如何将变量从一个python脚本传递到另一个脚本

2024-04-19 20:01:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我的代码有这样的结构

class Mapsframe(wx.Frame):

    def __init__(self):
        import application

class Example(wx.Frame,listmix.ColumnSorterMixin):
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs) 
        self.InitUI()

    def InitUI(self):

    def onItemSelected(self,event):

        frame = Mapsframe()

application是另一个正在运行的pythonsicpt,我想将在def onItemSelected内部本地创建的一些变量传递给python脚本application.py中的一个类。有什么想法吗?在


Tags: 代码selfapplicationinitexampledefargs结构