Building a trading platform with charts - suggestions for a Python GUI Library

雨燕双飞 提交于 2019-12-04 06:18:30
Brent Writes Code

For plotting in Python, I'm a big fan of Matplotlib (http://matplotlib.sourceforge.net/) which is essentially a more user-friendly wrapper built on top of Pylab (http://www.scipy.org/PyLab). It's really powerful and has a TONS of documentation and examples. It doesn't sound like your charts are very complicated, so you probably won't have to dig too deeply into the package; I think the development gets hairier the deeper into the API you get, but that's probably true of most packages.

I happened to end up using the Tkinter backend, but matplotlib also supports QT, WxPython and others. I'm not a huge fan of Tkinter or WxPython and probably would've used QT instead given the choice, but it's nice that all the options are there. I've used matplotlib on both Linux and Mac OS X with a lot of success.

As a side note, here's an interesting related SO post on plotting in WxPython if you decide to go that route: What is the best real time plotting widget for wxPython?

Go straight with wxPython if you feel it comfortable. There are a lot of toolkits out of there and they all have pros and cons and you will always find people complaining about them... wxPython is a good choice, you are going to find a lot of documentation around the internet and it is highly interoperable with matplotlib, as sgusc said, and also with OpenGL if you want something more sophisticated for your plots. If you need to perform intensive calculations, before moving to another language, i suggest you to consider cython (http://cython.org/) that can speed up your code but unless you see that speed becomes a problem stick to a single language. Pay attention not to mix the logic with your gui and I think it would be fine. If you want some good references look at:

  1. http://www.blog.pythonlibrary.org/
  2. http://zetcode.com/wxpython/

Enjoy :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!