notebook
notebook copied to clipboard
how to automatically add blank space besides "="
Dear all,
When I type x=1 in jupyter notebook, how can I automatically add blank space between =,that is to say "x = 1" . Also,when I type x>1, I hope it can type as "x > 1".
Best, Raymond
Hello, If you are assigning 1 to x, what difference does the blank space make? compiler skips through the blank spaces anyway, If you meant something else, do let me know. Similarly, x>1 will return true/false on basis of value of x, the blank space will not change a thing.
@zdlspace0528 I see you want to style your code in PEP8 style. You can do this by installing an extension and it automatically does that for all the cells.
Hi, does anyone know which part of the repository/code needs to be edited to fix this issue? I am currently trying to work on it right now to add a space before and after the inequality symbols like OP wants. I would appreciate any help!
I see you want to style your code in PEP8 style. You can do this by installing an extension and it automatically does that for all the cells.
Right, this sounds more like a styling issue than something that should be implemented in Jupyter Notebook.
There should be a couple linting extensions out there to format your code as you type (or on save), like with other IDEs. For example https://github.com/ryantam626/jupyterlab_code_formatter.
Maybe that would work for you use case? Or have you seen such feature in other editors available by default?