0

I want to write a p2p share software using python, it mainly used in windows, but can also works in linux. So I've tried some frameworks/libraries such as Twisted, Gevent, and Tornado(may be tornado is not a good one for windows desktop client).

But I don't know which one to choose.

Twisted is a little big, I think... I think Gevent is more useful in *nix platform. Tornado is a web server, so may be this one is not suitable for desktop app.

jiluo
  • 2,296
  • 3
  • 21
  • 34
  • What makes you think Twisted is "big"? It's smaller than Python. Also, why would it be a problem for a library to be "big" in this case? Desktops typically have vast amounts of persistent storage. – Jean-Paul Calderone Jun 08 '12 at 13:03

2 Answers2

1

Twisted is the most suited of these to the development of network applications. It contains the most support code for implementing protocols. Twisted also includes the best GUI library integration out of these. It works with Gtk (on Windows, too) and Qt3 and Qt4. It may also work with wxWidgets (though this is less well supported than Gtk or Qt3/4). It can integrate with the Windows GUI event loop as well.

Of course, it would be ridiculous to suggest that Twisted is the best suited library for your needs, given the extremely minimal (almost non-existent) description of your needs. I think it's likely that Twisted is at least as well suited, if not better suited, to the needs of an arbitrary network application than the other options you've listed (and, indeed, any of the other options available in Python). However, whether it is best suited to your particular case, I can't say.

Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122
0

I think the default for the underlying event loop for all of these in Windows will be based on Select (although it appears at least Twisted has platform specific support for IOCP).

Someone with a better understanding of the differences above that should probably comment but, from the developer's perspective the choice will largely be around preferred syntax. Twisted implements everything through a reactor pattern while gevent uses co-routines. I'd take a look at some simple examples of each and see which is better suited to your sensibility.

silijon
  • 922
  • 1
  • 8
  • 19
  • Twisted is compatible with coroutines (as, I suspect, gevent is compatible with other non-coroutine approaches). Instead, the difference will largely be in available tools and reliability. – Jean-Paul Calderone Jun 11 '12 at 17:24