1

I am using Jupyter Notebook with the Python 3 ipykernel. If I paste code from a text editor into the Jupyter Notebook, all the hidden characters (in the text editor) show up as visible characters.
It is strange: e.g., I can backspace and erase the space hidden character, then hit space and it does not reappear.

What is happening and how do I disable it?

I tried to paste the character here, but they disappear. Here is an image for reference: enter image description here

To resolve this issue, I use crtl+a, tab, shift+tab, and the hidden characters disappear. I am use Sublime 3 as a text editor, but if I open gedit, and I type exactly what is displayed in the image and paste in Jupyter Notebooks, I still see the hidden characters. This issue is new (e.g., it wasn't occurring just a week ago).

Ralff
  • 401
  • 2
  • 5
  • 15
  • 2
    While we typically discourage images of code or other textual data, this seems like a case where a screenshot would be very helpful. – CrazyChucky Feb 18 '23 at 05:44
  • 2
    Kindly paste (image) screenshot as @CrazyChucky indicated. Kindly write ✍️ snippet of your corrected code. Here's an example of a [question with screenshot and code](https://stackoverflow.com/questions/64701552/displaying-special-characters-in-jupyter-notebook). Would be great if you indicate the text editor. – semmyk-research Feb 18 '23 at 05:57
  • I added an image to the question, and I added info on the text editor. Surprisingly, I am seeing the issue regardless of the text editor. – Ralff Feb 19 '23 at 18:46

1 Answers1

3

I am use Sublime 3 as a text editor

Your complaint boils down to "my text editor is indenting with TAB character rather than with four SPACE characters".

You can verify that diagnosis with tail my_source_code.py | hexdump -C and notice the 0x09 (decimal nine) TAB characters instead of 0x20 (decimal 32) SPACE characters.


Visit the Preferences screen in your editor and ask it to use SPACE instead of TAB.

J_H
  • 17,926
  • 4
  • 24
  • 44