Im developing a financial python/wx/sqlite and the client requested me a
chart. I first thought about using win32com to call excel but didnt sound so
clean to me. I googled a little and found matplot. Seems really great even
becouse it could be embedded on WX applications. But since im out of time i
just used the simplest example without embedding anything:

from pylab import *
class VButler(wx.Frame):
     (...)
        def first_chart (self,ticks):
           display = self.load_indicatorVol(ticks)
           colors=['ro','bo','go','yo','rs','bs','gs','ys']
           for row in display:
              try:
                   cor=colors.pop(0)
              except:
                   colors=['rx','bx','gx','yx','rv','bv','gv','yv']
                   cor=colors.pop(0)
              plot([float(row[2])],[float(row[3])],cor)
              text(float(row[2]),float(row[3]),row[0])
           axis([0,10,0,25])
           show()

When i tryed to print using printing_in_wx.py i couldnt. It would only print
a part of the graphic, if i tryed to preview the print it would show me a
blank page. Ctrl+c had a problem since event.KeyCode is not a function and
was called like one, but fixed that it would copy the image to clipboard OK.

My boss is requesting me this software as soon as yesterday so i gave him
the option of first saving it as a PNG and then print... When i tryed to
build a py2exe i got some problems...
# My Setup Code
VolatilityButler = Target(
   # used for the versioninfo resource
   description = "VolatilityButler",
   version = "1.2.1",
   company_name = "Sala 1 / La Colina",
   name = "VolatilityButler",

   # what to build
   script = "vol_butler.py",
   other_resources = [(RT_MANIFEST, 1, manifest_template %
dict(prog="VolatilityButler")),],
   icon_resources = [(1, "butler.ico")],
   dest_base = "VolatilityButler")
setup(
   options = {"py2exe": {"compressed": 1,
                         "optimize": 2,
                         "ascii": 1,
                         "bundle_files": 1}},
   zipfile = None,
   windows = [VolatilityButler],
   )

#Error after running it
The following modules appear to be missing
['FFT', 'LinearAlgebra', 'MA', 'MLab', 'Matrix', 'Numeric', 'Pyrex', '
Pyrex.Compiler', '_curses', 'backends.draw_if_interactive','
backends.new_figure_manager',................]

it was alot of modules not found and when i tryed to run the exe

Traceback (most recent call last):
 File "vol_butler.py", line 14, in <module>
   from pylab import *
 File "zipextimporter.pyo", line 82, in load_module
 File "pylab.pyo", line 1, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\pylab.pyo", line 199, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\cm.pyo", line 5, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\colors.pyo", line 33, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\numerix\__init__.pyo", line 147, in <module>
ImportError: No module named random_array

i looked at some setup.py examples, but they are from python 2.3 and using a
'share' folder that i dont have in my Python2.5 folder. But i tryed to make
it like the example.
data = glob.glob('C:\Python25\Lib\site-packages\matplotlib\*')
setup(
   options = {"py2exe": {"compressed": 1,
                         "optimize": 2,
                         "ascii": 1,
                         "bundle_files": 1}},
   zipfile = None,
   windows = [VolatilityButler],
   data_files=[("matplotlibdata",data)],
   )


and the error while running the setup:
*** copy data files ***
error: can't copy 'C:\Python25\Lib\site-packages\matplotlib\backends':
doesn't exist or not a regular file
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to