开发者

Expand width of shell in Python's IDLE

I'm new to python and开发者_JS百科 I'm using Python's IDLE. Using numpy, I created a 24 x 24 matrix. I simply want to look at the matrix. I've maximized the shell on my monitor, so there's plenty of room to print the entire 24 columns' width, but it's only printing the first 13 columns of then continuing onto the next line to print the next 11 columns (had trouble in Stack Overflow copying and pasting what it's doing). The entire right half of the Shell window is blank (it's compressing everything to fit in the left half).

This is harder to read than if it printed 24 columns wide. Can anyone tell me how to convince IDLE to print using the entire width available of the shell (rather than just the left half)? I recognize this is a bit of a stupid question and apologize, but it's driving me crazy.

It looks sort of like this (again, Stack Overflow problems in trying to paste):

[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])

Thanks, Mitch


Do

import numpy as np
np.set_printoptions(linewidth=999999)

For more, check

help(np.set_printoptions)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜