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

not working on windows wint mingw64 console #36

Open
matsonkepson opened this issue Aug 22, 2018 · 6 comments
Open

not working on windows wint mingw64 console #36

matsonkepson opened this issue Aug 22, 2018 · 6 comments

Comments

@matsonkepson
Copy link

Trerminal windows 10 > MINGW64
$ python --version
Python 3.6.5

$ python -m wpm
Traceback (most recent call last):
File "C:\Python36\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\Python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\temp\wpm\wpm_main
.py", line 14, in
import wpm.commandline
File "C:\temp\wpm\wpm\commandline.py", line 22, in
import wpm.config
File "C:\temp\wpm\wpm\config.py", line 14, in
import curses
File "C:\Python36\lib\curses_init
.py", line 13, in
from _curses import *
ModuleNotFoundError: No module named '_curses'

@matsonkepson
Copy link
Author

after installing missing modules manually

getting the answer "Redirection is not supported"

user@host MINGW64 /c/temp/wpm (master)
$ pip install curses-2.2+utf8-cp36-cp36m-win_amd64.whl
Processing c:\temp\wpm\curses-2.2+utf8-cp36-cp36m-win_amd64.whl
Installing collected packages: curses
Successfully installed curses-2.2+utf8

user@host MINGW64 /c/temp/wpm (master)
$ python -m wpm

Redirection is not supported.

@matsonkepson
Copy link
Author

$ wpm

Redirection is not supported.

@cslarsen
Copy link
Owner

I don't own a Windows system, so I can't look into this. But you can probably google it and find out if curses is fully supported on the windows command shell like you're using. By "fully" I mean that all the attributes and stuff are translated (in theory, I guess it should work just fine, but it may not be so in practice).

@matsonkepson
Copy link
Author

heh, I will try :)

What I can add from my side that I was trying to run it in PowerShell/cmd but it is exiting with the same exit error

PS C:\temp\wpm> python -m wpm
Traceback (most recent call last):
File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\temp\wpm\wpm_main
.py", line 17, in
wpm.commandline.main()
File "C:\temp\wpm\wpm\commandline.py", line 237, in main
with wpm.game.GameManager(quotes, stats, opts.cpm) as gm:
File "C:\temp\wpm\wpm\game.py", line 45, in init
self.screen = Screen()
File "C:\temp\wpm\wpm\screen.py", line 70, in init
self.set_colors()
File "C:\temp\wpm\wpm\screen.py", line 153, in set_colors
hicolor = os.getenv("TERM").endswith("256color")
AttributeError: 'NoneType' object has no attribute 'endswith'

Also was able to get the first screen by the https://conemu.github.io/ soft but after typing the first letter i got this

C:\temp\wpm (master -> origin)
λ python -m wpm
Traceback (most recent call last):
File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\temp\wpm\wpm_main
.py", line 17, in
wpm.commandline.main()
File "C:\temp\wpm\wpm\commandline.py", line 239, in main
gm.run(to_front=text_ids)
File "C:\temp\wpm\wpm\game.py", line 99, in run
head = self.get_stats(self.elapsed)
File "C:\temp\wpm\wpm\game.py", line 162, in get_stats
"%5.1f wpm" % self.wpm(elapsed),
File "C:\temp\wpm\wpm\game.py", line 128, in wpm
return min((60.0 * self.position / 5.0) / elapsed, 999)
ZeroDivisionError: float division by zero

@cslarsen
Copy link
Owner

cslarsen commented Sep 4, 2018

Yeah, the hicolor part is very unix specific, so just skip those TERM parts. As to div by zero, seems elapsed doesn't have a value. Just return any float value there while testing (or check if elapsed is zero).

@idanpa
Copy link

idanpa commented May 13, 2019

Hi @cslarsen, thank you for publishing this application!
Managed to get it working on native windows, could you please review #47?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants