fumitoh / modelx

Use Python like a spreadsheet!
https://modelx.io
GNU Lesser General Public License v3.0
90 stars 20 forks source link

Is there a way to print what's inside type Space? #3

Closed Sheing closed 6 years ago

Sheing commented 6 years ago

I wanted to get more infos from type Space, I tried JSON dumps(space), but failed.

fumitoh commented 6 years ago

Assuming space is in model, try:

from PyQt5.QtWidgets import QApplication
app = QApplication.instance()
if not app:
    app = QApplication(sys.argv)

view = get_modeltree(mx.cur_model())
view.show()
app.exec_()
figure_1
Sheing commented 6 years ago

Thanks for the quick reply, it works. I found out there's another tiny error --> from modelx.core.cells import CellPointer, CellPointer is not defined in space, you might want to comment out CellPointer.

fumitoh commented 6 years ago

I assume you're referring to a line in sample_lifetable.py. This sample is not maintained so I'll remove the file from repo. Thanks for pointing that out.