アプリケーションの残りの部分が続行している間、非同期でエラーメッセージを表示する別のプロセスを生成したいと思います。
Python 2.6のモジュールを使用しmultiprocessingてプロセスを作成し、ウィンドウをで表示しようとしていますTKinter。
このコードはWindowsでは問題なく機能しましたが、Linuxで実行するとTKinter、を呼び出してもウィンドウが表示されません'showerror("MyApp Error", "Something bad happened.")'。直接呼び出して同じプロセスで実行すると表示されますshowerrorprocess。これを考えると、それTKinterは適切に機能しているようです。コンソールに印刷したり、によって生成されたプロセスから他のことを実行したりmultiprocessingできるので、それも機能しているようです。
彼らはただ一緒に働いていないようです。生成されたサブプロセスがウィンドウを作成できるようにするために、何か特別なことをする必要がありますか?
from multiprocessing import Process
from Tkinter import Tk, Text, END, BOTH, DISABLED
import sys
import traceback
def showerrorprocess(title,text):
    """Pop up a window with the given title and text. The
       text will be selectable (so you can copy it to the
       clipboard) but not editable. Returns when the
       window is closed."""
    root = Tk()
    root.title(title)
    text_box = Text(root,width=80,height=15)
    text_box.pack(fill=BOTH)
    text_box.insert(END,text)
    text_box.config(state=DISABLED)
    def quit():
        root.destroy()
        root.quit()
    root.protocol("WM_DELETE_WINDOW", quit)
    root.mainloop()
def showerror(title,text):
    """Pop up a window with the given title and text. The
       text will be selectable (so you can copy it to the
       clipboard) but not editable. Runs asynchronously in
       a new child process."""
    process = Process(target=showerrorprocess,args=(title,text))
    process.start()
編集
問題はTKinter、親プロセスによってインポートされ、子プロセスに「継承」されたようですが、どういうわけか、その状態は親プロセスと密接に関連しており、子プロセスでは機能しません。子プロセスを生成する前にインポートしないように注意する限りTKinter、それは機能します。これは、子プロセスが初めてインポートするためです。