Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The demo does not work as the demo image shows #2

Open
aqasoft opened this issue Jan 14, 2022 · 13 comments
Open

The demo does not work as the demo image shows #2

aqasoft opened this issue Jan 14, 2022 · 13 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@aqasoft
Copy link

aqasoft commented Jan 14, 2022

Hi! The demo code you posted leaves successive screens with the following text:
←[0;0f
before each print.
Working on W10, with Python 3.9.
Visual Studio Code, "externalTerminal" on launch.json.

@aqasoft
Copy link
Author

aqasoft commented Jan 14, 2022

Happened with the previous example (the sinus wave) and with the current one (clock).

2022-01-13_22-35-07

@Matthias1590
Copy link
Owner

Matthias1590 commented Jan 14, 2022

Hey there! The demo was recorded on Windows 10 using Python 3.9 so that's odd.. Seems like an issue with the terminal you're running the program in. Could you record your vs code terminal?

@aqasoft
Copy link
Author

aqasoft commented Jan 14, 2022

Hi Matthias! Yes indeed, I am sending you two recordings, the first, as you asked, from VScode internal terminal and the second one from an external terminal just calling the demo file without any obtrusions.

1:
2022-01-14_10-08-01

and 2:
2022-01-14_09-51-43

@Matthias1590
Copy link
Owner

Thanks for reporting this! I was unaware that the module did not work in the windows command prompt and I'll try to find a way to make it work there too, I'll let you know when this is solved.

@Matthias1590
Copy link
Owner

I just released version 2.4.0, it should be fixed (if it is, please close this issue :)), thanks again for reporting this!

@Matthias1590 Matthias1590 added the bug Something isn't working label Jan 14, 2022
@aqasoft
Copy link
Author

aqasoft commented Jan 14, 2022

Hi Matthias, I cannot install the new release of ConsoleDraw nor build it from a local repo clone:

Installing directly from GIT since normal pip install consoledraw brings v3.x:

> pip install git+https://github.com/Matthias1590/ConsoleDraw.git
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/Matthias1590/ConsoleDraw.git
  Cloning https://github.com/Matthias1590/ConsoleDraw.git to c:\users\rango\appdata\local\temp\pip-req-build-b9wx8ixk
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RANGO\\AppData\\Local\\Temp\\pip-req-build-b9wx8ixk\\setup.py'"'"'; __file__='"'"'C:\\Users\\RANGO\\AppData\\Local\\Temp\\pip-req-build-b9wx8ixk\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\RANGO\AppData\Local\Temp\pip-pip-egg-info-x2f6pnmy'
         cwd: C:\Users\RANGO\AppData\Local\Temp\pip-req-build-b9wx8ixk\
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\RANGO\AppData\Local\Temp\pip-req-build-b9wx8ixk\setup.py", line 13, in <module>
        long_description=readme(),
      File "C:\Users\RANGO\AppData\Local\Temp\pip-req-build-b9wx8ixk\setup.py", line 6, in readme
        return f.read()
      File "c:\program files\python39\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 890: character maps to <undefined>
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Or trying to run setup.py from my desktop:

d:\Users\RANGO\Documents\GitHub\ConsoleDraw>py setup.py build
Traceback (most recent call last):
  File "d:\Users\RANGO\Documents\GitHub\ConsoleDraw\setup.py", line 13, in <module>
    long_description=readme(),
  File "d:\Users\RANGO\Documents\GitHub\ConsoleDraw\setup.py", line 6, in readme
    return f.read()
  File "C:\Program Files\Python39\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 890: character maps to <undefined>

Really glad I can be of help in any way that you think.

@Matthias1590
Copy link
Owner

Should be fixed now, thanks for letting me know!

@aqasoft
Copy link
Author

aqasoft commented Jan 15, 2022

It installs properly now!
However:

  1. It continues to work flawlessly in VScode's integrated terminal.
  2. It looks much better, but it jumps up and down and skips seconds (back and forth) in CMD. Take a close look to the seconds in the image:

2022-01-14_21-48-26

@Matthias1590
Copy link
Owner

Is that in cmd or in the python console? I believe there is a difference between the two and it worked for me in cmd, haven't tested it in the python console yet tho

@aqasoft
Copy link
Author

aqasoft commented Jan 15, 2022

It's not the Python Console. It is a standard CMD console, I've tried opening it in Admin mode, resizing fonts, many options.
I've even tried the sample code directly from ConEmu, and it produces the same effect as shown in the last gif.

I've just also tried with another PC, Python v3.10.0, W10 up-to-date, standard CMD console and the effect is the same.

I think maybe you should try in a clean VM? Maybe your testing environment is using some non-standard additional piece of software.

@Matthias1590
Copy link
Owner

Very odd, it behaves like that for me in the Python console but works in CMD. I tried testing on a vm and it gave me the expected result, could you show me what it looks like in the Python console?

@aqasoft
Copy link
Author

aqasoft commented Jan 16, 2022

I have two tests to report:

1. Python IDLE console. Fails when executing the demo code with the following output info:

>>> 
======================= RESTART: D:\_devpy\test\test1.py =======================
Traceback (most recent call last):
  File "D:\_devpy\test\test1.py", line 5, in <module>
    console = Console()
  File "C:\Program Files\Python39\lib\site-packages\consoledraw\console.py", line 19, in __init__
    self.update()
  File "C:\Program Files\Python39\lib\site-packages\consoledraw\console.py", line 72, in update
    grid = self.__generate_grid()
  File "C:\Program Files\Python39\lib\site-packages\consoledraw\console.py", line 31, in __generate_grid
    size = os.get_terminal_size()
ValueError: bad file descriptor
>>> 

screen capture:

Clipboard01

2. Tested on a brand new fresh and clean install of W10Pro (old version: 1909) on VMware. The only SW added was GIT and Python 3.10.1.
ConsoleDraw was installed using the GIT repository, having the CMD console both in Admin mode and normal user mode (the target folder for the installations is different).

It produces the same result of the digital watch jumping up and down one line and the seconds skipping back and forth one second. Sorry to report this one, I really expected a different result.

original screen capture of the observed behavior:

2022-01-14_21-48-26

@Matthias1590
Copy link
Owner

Might take me a while to figure this one out, I'll keep you updated and do my best though.

@Matthias1590 Matthias1590 added help wanted Extra attention is needed good first issue Good for newcomers labels May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants