0

My Background: Very new to Python. Using SPYDER as editor.

The issue: When i run a piece of code or open a help file in SPYDER, I am unable to control the pagination on the iPython console window.

For those who have used MATLAB: The "more (on)" or "more (off)" shows output on the Command window till the end of the page ..and when one hits the space bar it would advance one line at a time ...this is particularly useful when reading help files....I am using SPYDER now and i would like to do the same in the iPython Console "below" the editor...

I searched around the closest help I found was this: Can't get ipython console in spyder

None of them work for the SPYDER environment. Is there is an easier way to set up the SPYDER environment to do this? or is there a specific command to do so? Googling and messing around in the settings under Run / configure and Tools / Preferences has so far been useless.

Additionally, if there is a way to print the output of a variable without using the print command, Please let me know.

a = 1 print (a)

to be replaced by a ?

Please advise.

Vas
  • 1
  • 1

2 Answers2

0
In [351]: a=1;a
Out[351]: 1

I use ipython all the time (but not with spyder), and don't worry about pagination (and when I pull up a Octave session, I turn it off).

If I assign a value to a variable, I don't get a listing (no worries about forgetting the add the silencing ;). If I want to look at a variable, or output without assignment, I accept the whole listing, or take steps to limit the display (with slices). Large numpy arrays are condensed anyways (with ellipses). So a long, run away, list display is more of a nuisance.

Ipython documentation and code displays (with ? and ??) are paged. The usual less style of controls work.

In [354]: np.arange(1001)
Out[354]: array([   0,    1,    2, ...,  998,  999, 1000])

In [355]: list(range(100))
Out[355]:                    # ipython's pprint for long lists
[0,
 1,
 2,
 3,
 4,
 5,
 6,
 7,
...
In [356]: alist =list(range(100))
In [357]: alist[:10]
Out[357]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
In [358]: print(alist)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]

There may be a way of turning on paging for that long list display, but I haven't felt a need to hunt for it.

Does iPython have built-in support for viewing a variable in pager?

Paging stdout output in IPython

hpaulj
  • 221,503
  • 14
  • 230
  • 353
0

(Spyder maintainer here) There's no such option to do what you want, sorry.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
  • Oh thanks ...I am gettin that flavor after much searching...i guess one has to keep scrolling up or buy a huge monitor :) – Vas Oct 12 '18 at 00:18
  • Also carlos could you point me to a forum or place where people have spefiic Spyder<=Python=>Matlab and Matlab<=Python=>Spyder questions? I have found a few ..but people go off on tangets and I am finding it hard as a beginner! – Vas Oct 12 '18 at 00:21
  • There's no such forum either, sorry. You can ask further question in our [Gitter channel](https://gitter.im/spyder-ide/public) though. – Carlos Cordoba Oct 15 '18 at 00:06