Hello Alexandre,

His is how I had it before, but it was causing me problems and I was told that it's better tu run them in separate threads. Do you use twistd (.tac files)? I'll have a look at your application, thanks!

Gabriel

Alexandre Quessy wrote:
Hi everyone,
I use Twisted everyday, and have worked on a wx GUI for an application
using it. We also use Py2App to bundle it up. It works flawlessly. I
use the Twisted main loop, which controls the wx events loop.

To make both of them work together, you need to do the following :

{{{
from twisted.internet import wxreactor
wxreactor.install()
}}}

You can check our RawMaterials application since it is free software.
It has a lot of dependencies, so it is rather difficult to build.
https://svn.sat.qc.ca/trac/rawmaterials/browser/trunk/src/RawMaterials.py
We use a shell script to build and copy things in the .app :
https://svn.sat.qc.ca/trac/rawmaterials/browser/trunk/src/make_app.sh

I would say the problem is probably more about multiprocessing than wx
and twisted. Using subprocess, or pexpect, or commands might be a
better idea.

a

2009/8/14 Gabriel Rossetti <gabriel.rosse...@arimaz.com>:
Christopher Barker wrote:
Gabriel Rossetti wrote:
no SSH, nothing) and I have to had reboot it. It uses a combination of
Twisted and wxPython and is rather large, so I don't know where this comes
from, it could be wx, twisted or the two together.
It's probably not wx -- it is used a fair bit on Macs.

I don't know how much Twisted is used on the Mac. It might be worth asking
on a Twisted list. Also, have you tried just a simple Twisted app on its
own?

And yes, I suppose the two together could be an issue.
Yes actually, it was the two together. I used something someone had told me
about a some time ago, that is to use the wx eventloop as the main eventloop
and have twisted's run in a separate thread, it now works fine on Mac.

I'm still working on the pz2app part though, I'll kep everyone updated.

Gabriel

Oh, and do you have these problems running without py2app?

Popen could not find my files when using py2app,
This should be a simple path issue -- a few judicious print statements
should help here.

even though they were in the same

directory as the main exec. I even tried putting the execs in the
resource dir but no luck,
hmm -- I think that is indeed where the working dir is set by py2app when
starting op. try:

print os.getcwd()

you can look in the "Console" app to see stuff printed to stdout.

-Chris

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig




_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to