Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 407f83a

Browse files
committed
catch ImportError if xlwt not installed
1 parent 19051a9 commit 407f83a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

examples/pylab_examples/loadrec.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
fig.autofmt_xdate()
1515

1616
# if you have xlwt installed, you can output excel
17-
import mpl_toolkits.exceltools as exceltools
18-
exceltools.rec2excel(a, 'test.xls')
17+
try:
18+
import mpl_toolkits.exceltools as exceltools
19+
exceltools.rec2excel(a, 'test.xls')
20+
except ImportError:
21+
pass
1922
show()

0 commit comments

Comments
 (0)