【问题标题】:How to read/write wxpython textctrl input in linux platform?如何在 linux 平台上读/写 wxpython textctrl 输入?
【发布时间】:2015-04-02 05:56:29
【问题描述】:

我有一个使用 wxpython 创建的 GUI,其中从文件对话框中获取的文件的路径驻留在我命名为 Repofield 的 textctrl 中。

self.Repofield=wx.TextCtrl(panel, pos=(120,25), size=(250,20))
value=self.Repofield.SetValue(dlg.GetPath())

现在我使用子进程将“”传递给命令:

cmd="./flash -0 -f %s"%(value)  
proc=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, universal_newlines=True)
out,err=proc.communicate()

在 windows 中,我们确实将文件路径写入注册表并在需要时从它(运行时)读取。它在 linux 中是如何工作的?

【问题讨论】:

    标签: python-2.7 wxpython


    【解决方案1】:

    Linux 中没有注册表。如果要保存文件路径,我建议使用 SQLite 之类的简单数据库。您也可以使用 Python 的 pickle 模块,或者将它们保存到配置文件中,然后使用 Python ConfigParser 模块对其进行读写。

    【讨论】:

      猜你喜欢
      • 2014-11-12
      • 2010-11-17
      • 2023-03-11
      • 2012-08-21
      • 1970-01-01
      • 2013-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多