How to see variables denoted by Greek letters in viscode's interactive window? - python

I'm currently using Python3.73 on VSCode. I execute the code on interactive window with Jupiter notebook. The problems are:
I can't type Greek letters in notebook cells while I can type them in editor using LaTeX syntax;
Even if I copy a Greek letter from somewhere else and paste it in a cell in interactive window and denote it as the name of a variable, I can't find this variable in the interactive data viewer. But I'm sure it's stored somewhere because I can still call it again.
e.g.
example code
, but the eigenvalues can't be seen after clicking the
"Show variable in data viewer button"
So how can I type Greek letters in interactive cells directly? and how can I see variables denoted by Greek letters?

how can I type Greek letters in interactive cells directly?
Jupyter Notebook can recognize Greek letters, after typing \alpha, pressing Tab, you'll get α, which you can try in JupyterLab. But it's not achievable in VS Code.
Although Greek letters' English name are stored in Jupyter in VS Code, but it couldn't be turned into α automatically in VS Code. Furthermore, to Tab Complete Greek Letters, the production group vscode-jupyter does't have plans on adding this functionality at this time.
how can I see variables denoted by Greek letters?
The default encoding format is UTF-8. Not only Greek, but also Cyllic and other non-english language can't be shown in Variables Viewer. So there's no way to do that.

I was also missing this feature from vscode. Luckily, there is now the tablatex extension, that does exactly what you want:
https://marketplace.visualstudio.com/items?itemName=andyljones.tablatex

Related

I paste code in a jupyter notebook. The hidden characters from text editor are copied. How to disable this?

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:
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).
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.

Why does the Jupyter Notebook output is displaying arrays from right to left

I am working with Jupyter Notebook, writing some python code using numpy library.
For some reason, The output of arrays (as well as lists and strings) are displyed from right to left.
Is your system set up for Hebrew? Note that the :[4] In is on the right as well. That may trigger array output to be right-to-left.
From this comment on github:
Press Ctrl-Shift-F to bring up the command palette. Search for 'rtl'
and select 'toggle rtl layout'. It should switch around.
If the first language selected in your browser is Arabic or Hebrew, it
currently selects RTL by default. CCing #samarsultan in case that
needs refining.
Thanks.
Now it works fine.
My browser was set to hebrew and by changing to english it fixed the problem.

How to create text expander with Python?

I would like to write a program that replaces a certain sequence of symbols with other symbols (text expander).
This program should run in the background of the OS, and if user writes the defined symbols anywhere (for example, in this post), it is automatically replaced with another defined symbol.
For example: 'delta_low' -> 'δ'
I know how to detect and replace symbols. But how should I implement the code so that it runs in the background?
Note: I am currently focusing on Windows.

Pyinstaller and displaying korean characters

I'm a beginner and I created a small flash card script to help me study korean. the script uses a two column spreadsheet with A being the Keys, and B being the definition. I then used pyinstaller --onefile to change it into a one-ish file(still needs the spreadsheet) .exe to run.
The question is when it displays the Korean characters such as 자다 in the text window it displays two [?][?] boxes, how do i get it to display the true characters?
I was able to use the script, and view all korean characters while i was coding it in pycharm
Thanks!

Pound sign a bunch of code at once in psychopy for mac

this is a very basic question, but is there a way to put '#' next to a highlighted bunch of code in psychopy for mac?
Edit: if you are using psychopy for mac you can press ctrl-' to input, ctrl-shift-' to remove.
Like the comments said, this is an editor issue and not a Python programming question. The closest thing there is to a "standard Python editor" is probably the one built into Idle, the IDE that comes with every CPython distribution. There, you can
Highlight the lines you want to comment out
Use Format>Comment Out Region from the menu or press Alt+4 at a PC keyboard.
This works in the module editor, not the shell, and uses a double pound sign as a hint that the lines were commented-out in a block operation.
Any editor with regular expression search and replacement and also with a "replace all within selection" option will work, too. Just highlight the lines and change all occurrences of ^ to # within that selection.

Categories

Resources