weird escape chars instead of lines
Opened this issue · 5 comments
gilbh commented
two problems:
- I just installed with pip and ran a test script for hook. Odd results. This is in Windows 10 command line:
(utils) C:\Dropbox\Documents_and_Writings\Research\Digital_Humanities\Python>pip install frosch
Collecting frosch
Downloading frosch-0.1.7-py3-none-any.whl (14 kB)
Collecting asttokens<3.0.0,>=2.0.4
Downloading asttokens-2.0.4-py2.py3-none-any.whl (20 kB)
Requirement already satisfied: six in c:\users\gil\envs\utils\lib\site-packages (from asttokens<3.0.0,>=2.0.4->frosch) (1.15.0)
Collecting colorama<0.5.0,>=0.4.4
Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting Pygments<3.0.0,>=2.7.2
Downloading Pygments-2.7.3-py3-none-any.whl (950 kB)
|████████████████████████████████| 950 kB 2.2 MB/s
Collecting pytest-sugar<0.10.0,>=0.9.4
Downloading pytest-sugar-0.9.4.tar.gz (12 kB)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\gil\envs\utils\lib\site-packages (from pytest-sugar<0.10.0,>=0.9.4->frosch) (1.1.0)
Requirement already satisfied: packaging>=14.1 in c:\users\gil\envs\utils\lib\site-packages (from pytest-sugar<0.10.0,>=0.9.4->frosch) (20.4)
Requirement already satisfied: pyparsing>=2.0.2 in c:\users\gil\envs\utils\lib\site-packages (from packaging>=14.1->pytest-sugar<0.10.0,>=0.9.4->frosch) (2.4.7)
Collecting pytest>=2.9
Downloading pytest-6.2.1-py3-none-any.whl (279 kB)
|████████████████████████████████| 279 kB 3.2 MB/s
Requirement already satisfied: attrs>=19.2.0 in c:\users\gil\envs\utils\lib\site-packages (from pytest>=2.9->pytest-sugar<0.10.0,>=0.9.4->frosch) (19.3.0)
Requirement already satisfied: toml in c:\users\gil\envs\utils\lib\site-packages (from pytest>=2.9->pytest-sugar<0.10.0,>=0.9.4->frosch) (0.10.1)
Collecting atomicwrites>=1.0
Downloading atomicwrites-1.4.0-py2.py3-none-any.whl (6.8 kB)
Collecting pluggy<1.0.0a1,>=0.12
Downloading pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
Collecting py>=1.8.2
Downloading py-1.10.0-py2.py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 3.2 MB/s
Collecting stack-data<0.2.0,>=0.1.0
Downloading stack_data-0.1.0-py3-none-any.whl (20 kB)
Collecting yapf<0.31.0,>=0.30.0
Downloading yapf-0.30.0-py2.py3-none-any.whl (190 kB)
|████████████████████████████████| 190 kB 3.3 MB/s
Collecting executing
Downloading executing-0.5.4-py3-none-any.whl (12 kB)
Collecting iniconfig
Downloading iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
Collecting pure-eval
Downloading pure_eval-0.1.1-py3-none-any.whl (9.4 kB)
Building wheels for collected packages: pytest-sugar
Building wheel for pytest-sugar (setup.py) ... done
Created wheel for pytest-sugar: filename=pytest_sugar-0.9.4-py2.py3-none-any.whl size=8977 sha256=450a8aee9c6f1418955904f4d15e157340f920f76b40aa093f652d3e3880ce9f
Stored in directory: c:\users\gil\appdata\local\pip\cache\wheels\11\15\a5\18fe38a58318bf4aa4bc15c369d8dd7ec9210164812c48b8ba
Successfully built pytest-sugar
Installing collected packages: py, pluggy, iniconfig, colorama, atomicwrites, pytest, pure-eval, executing, asttokens, yapf, stack-data, pytest-sugar, Pygments, frosch
Attempting uninstall: colorama
Found existing installation: colorama 0.4.3
Uninstalling colorama-0.4.3:
Successfully uninstalled colorama-0.4.3
Attempting uninstall: Pygments
Found existing installation: Pygments 2.6.1
Uninstalling Pygments-2.6.1:
Successfully uninstalled Pygments-2.6.1
Successfully installed Pygments-2.7.3 asttokens-2.0.4 atomicwrites-1.4.0 colorama-0.4.4 executing-0.5.4 frosch-0.1.7 iniconfig-1.1.1 pluggy-0.13.1 pure-eval-0.1.1 py-1.10.0 pytest-6.2.1 pytest-sugar-0.9.4 stack-data-0.1.0 yapf-0.30.0
(utils) C:\Dropbox\Documents_and_Writings\Research\Digital_Humanities\Python>p test_frosch.py
�[38;5;26mTraceback (most recent call last):�[39m
�[38;5;252m File �[39m�[38;5;5m"C:\Dropbox\Documents_and_Writings\Research\Digital_Humanities\Python\test_frosch.py"�[39m�[38;5;252m, line �[39m�[38;5;5m4�[39m�[38;5;252m, in �[39m�[38;5;252m<module>�[39m
�[38;5;252m �[39m�[38;5;252mx�[39m�[38;5;252m �[39m�[38;5;68m=�[39m�[38;5;252m �[39m�[38;5;5m3�[39m�[38;5;252m �[39m�[38;5;68m+�[39m�[38;5;252m �[39m�[38;5;1m'�[39m�[38;5;1masdf�[39m�[38;5;1m'�[39m
�[38;5;9mTypeError�[39m�[38;5;252m: �[39m�[38;5;252munsupported operand type(s) for +: 'int' and 'str'�[39m
4 �[34m||�[0m �[38;5;252mx�[39m�[38;5;252m �[39m�[38;5;68m=�[39m�[38;5;252m �[39m�[38;5;5m3�[39m�[38;5;252m �[39m�[38;5;68m+�[39m�[38;5;252m �[39m�[38;5;1m'�[39m�[38;5;1masdf�[39m�[38;5;1m'�[39m
�[34m||�[0m │
�[34m||�[0m └── �[38;5;252mx�[39m�[38;5;252m �[39m�[38;5;68m=�[39m�[38;5;252m �[39m�[38;5;3mNone�[39m
�[34m||�[0m
Here's the code of test_frosch.py
:
from frosch import hook
# hook(theme='vim')
hook()
x = 3 + 'asdf'
When I try to run with IPython inside nvim Terminal -- nothing happens at all (as if the hook() does not, well, hook):
(utils) C:\Dropbox\Documents_and_Writings\Research\Digital_Humanities\Python
>ipython --pprint
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
In [4]: %run "C:\Dropbox\Documents_and_Writings\Research\Digital_Humanities
...: \Python\test_frosch.py"
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
C:\Dropbox\Documents_and_Writings\Research\Digital_Humanities\Python\test_frosch
.py in <module>
3 # hook(theme='vim')
4 hook()
----> 5 x = 3 + 'asdf'
TypeError: unsupported operand type(s) for +: 'int' and 'str'
In [5]:
Thanks!
Qix- commented
Windows 10 command line
Which terminal emulator? cmd.exe, Windows Terminal, powershell, etc.
inside nvim Terminal
Can you expand on this? Which environment are you running? By nvim do you mean neovim?
gilbh commented
gilbh commented
You can see in the above screen shot:
- for python, the characters come out wrong.
- for ipython, there is no hook.
Qix- commented
cmd.exe doesn't support ansi escape characters. Switch to Microsoft Terminal (from the app store). Not only is it faster but it's the all around better option. It's the new official terminal by Microsoft. It'll support all of the ansi escapes.
gilbh commented
Yup, Terminal did it. Is there any solution for ipython integration?
Gil Ben-Herut, PhD
Associate Professor
Director of Graduate Studies
Department of Religious Studies
University of South Florida
http://religious-studies.usf.edu/faculty/gbherut/
Check out my recent monograph *Śiva's Saints: The Origins of Devotion in
Kannada according to Harihara's *Ragaḷegaḷu
<https://global.oup.com/academic/product/sivas-saints-9780190878849?cc=us&lang=en&>and
the co-edited volume *Regional Communities of Devotion in South Asia:
Insiders, Outsiders, and Interlopers
<https://www.crcpress.com/Regional-Communities-of-Devotion-in-South-Asia-Insiders-Outsiders-and/Ben-Herut-Keune-Monius/p/book/9781138495838>*
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Tue, Dec 29, 2020 at 8:03 AM Qix ***@***.***> wrote:
cmd.exe doesn't support ansi escape characters. Switch to Microsoft
Terminal (from the app store). Not only is it faster but it's the all
around better option.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/Qix-/better-exceptions/issues/114#issuecomment-752067514>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJNTQQQPILE4Q32YUBHXHKDSXHHRVANCNFSM4VMO7MTA>
.