jupyter / qtconsole

Jupyter Qt Console
https://qtconsole.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
416 stars 200 forks source link

Turning off line wrapping in the iPython console #271

Open soldcake opened 6 years ago

soldcake commented 6 years ago

According to https://github.com/spyder-ide/spyder/issues/4904, this is issue in qtconsole.

Outputs of large tables and arrays are unreadable due to the line wrapping.

Need option to turn off line wrapping.

MarkMoretto commented 5 years ago

Just want to chime in and support this nearly a year later. I'm on a non-Anaconda version of Spyder (4.0.0.dev3) and wrapping in the console still produces a lot of unreadable data.

ifly6 commented 5 years ago

Dewit

astromancer commented 5 years ago

Would be great if automatic line wrapping could be disabled by the user. Probably need to add to this function, something along the lines of

control.setLineWrapColumnOrWidth(10000)
control.setLineWrapMode(QtGui.QTextEdit.FixedPixelWidth)

Anyone who has more experience with Qt know what else would be needed?

Eheran1 commented 3 years ago

Another 1.5 years later, I need this too. Due to the numbers wraping its almost impossible to compare them from line to line, while they should be right next (above/below) to each other.

NotNormallyAGitUser commented 1 year ago

I don't normally use GitHub but was led here by an internet search. I see the green oval with the word "Open" inside. Would I be correct in concluding that this is still unresolved? I am using Spyder installed via Anaconda on Windows 10 and I see no preference switch for disabling line wrapping, and it has been almost 6 years since this was first mentioned on UseNet: https://groups.google.com/g/spyderlib/c/4ZJmwM2ZaP0. It's a pretty basic and essential function, so I wonder if I'm properly understanding the situation.

As a possible solution, I cannot use Spyder's Variable Explorer to view wide PySpark DataFrames, but it does show native data types fine. The GUI popup message says that the kernel is dead, but it obviously isn't because it can process Python commands. The IPython console is a bit more informative, but since I'm still trying to get to know Spark, I don't really understand it, though suspect that it boils down to something like "Spyder can't access PySpark DataFrames":

"It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063"

Googling SPARK-5063 yields discussions, but I will need to know Spark better in order to be sure of what they mean.

All this to say that being able to disable line wrapping would be very welcome. I hope that I am wrong in concluding that it still can't be disabled.

ccordoba12 commented 1 year ago

Hey @NotNormallyAGitUser, please post a screenshot of what you're seeing when viewing PySpark DataFrames in Spyder so we can better understand the situation.

NotNormallyAGitUser commented 1 year ago

@ccordoba12: The following code is adapted from https://sparkbyexamples.com/pyspark/pyspark-read-csv-file-into-dataframe and the input data file is https://github.com/spark-examples/pyspark-examples/blob/master/resources/zipcodes.csv.

  from pyspark.sql import SparkSession
  spark = SparkSession.builder \
     .appName("SparkExamples.com").getOrCreate()
  df = spark.read.csv(
     r"C:\cygwin64\home\User.Name\tmp\zipcodes.csv",
     header=True )
  df.show()

image

ccordoba12 commented 1 year ago

Thanks for the example @NotNormallyAGitUser. I'll try to address this in the next Qtconsole version (5.5.0), to be released next week.

ccordoba12 commented 11 months ago

Hey guys, I took a look at this issue and it's going to take more time than I expected. That's because it also needs a graphical option on the Spyder side so users can turn off wrapping (I thought they could do it directly in the console).

So, I'm going to leave it for Spyder 6, to be released at the beginning of next year. Thanks for understanding.

NotNormallyAGitUser commented 11 months ago

Thanks for the update, ccordoba12.