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

Asciimatics doesn't work pycharm #29

Closed
Sashachan opened this issue Jun 13, 2016 · 8 comments
Closed

Asciimatics doesn't work pycharm #29

Sashachan opened this issue Jun 13, 2016 · 8 comments

Comments

@Sashachan
Copy link

I have downloaded Asciimatics using pycharm with required dependencies,like pillow and future. I tested this on Python 3.3.5 and 3.5, but the test code from https://github.com/peterbrittain/asciimatics doesn't work. There are errors:

X:\Python33\python.exe C:/Users/Sasha/PycharmProjects/untitled/main.py
Traceback (most recent call last):
  File "C:/Users/Sasha/PycharmProjects/untitled/main.py", line 20, in <module>
    Screen.wrapper(demo)
  File "X:\Python33\lib\site-packages\asciimatics\screen.py", line 825, in wrapper
    info = old_out.GetConsoleScreenBufferInfo()
pywintypes.error: (6, 'GetConsoleScreenBufferInfo', 'Nieprawidłowe dojście.')
@peterbrittain
Copy link
Owner

peterbrittain commented Jun 13, 2016

Are you trying to run this inside the pycharm console? If so, what version of asciimatics are you running?

@Sashachan
Copy link
Author

1.6
I'm kinda newbie, so maybe this is the problem.
Yes i'm running it inside pycharm console. I thought that external console/terminal would pop out after running this code. If it's not by the default, is it possible to change it to external normal console?

@peterbrittain
Copy link
Owner

peterbrittain commented Jun 14, 2016

OK - I see what you're doing...

PyCharm isn't actually using a standard Windows command line interpreter. It is wrapping the interpreter and redirecting stdin/stdout to print that back into its console window. This is not compatible with the Win32 API that controls console output. The same is basically true for the Linux/OSX variants (though the implementation details vary considerably).

Version 1.7 of asciimatics has done a lot to allow you to run UTs inside PyCharm, but because it is not a real console, the output from any live applications just gets discarded. If you want to start up an application from the IDE, the best I can suggest right now is start a "Terminal" using Alt-F12. Once you have done this you can run your application by typing start cmd /c "python <your file name>".

I've just tested this on V1.7, but (since this actually starts a real command line) it should work just fine on V1.6 too.

@Sashachan
Copy link
Author

Hah, it is working like a charm! I had to add python to PATH, but thanks to this command everything is cool now. Thank you very much.
Btw is version 1.7 publicly released? Because i can only see v 1.6 on pypi.

asciimatics

@peterbrittain
Copy link
Owner

Excellent! I'll have a think about some trouble-shooting advice I can add to the docs and then close this issue.

In answer to your question: V1.7 is the latest code on the master branch in GitHub. It has not yet gone public...

@peterbrittain
Copy link
Owner

Added to troubleshooting.

@diVineProportion
Copy link

asciimatics works fine in pycharm. edit the build/run configuration and select 'Emulate terminal in output console' under the 'Execution' category

@peterbrittain
Copy link
Owner

Thanks @diVineProportion . Can you confirm what version of Pycharm and which OS you are using?

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

No branches or pull requests

3 participants