+ 4

I need some Degugging colored table support?

This Colored Table By Vitya isn't working for me I use Windows and the Microsoft Visual Studio. https://code.sololearn.com/cy5t2Fcz6lrv/?ref=app

10th Nov 2021, 12:13 AM
Bionical Man
Bionical Man - avatar
35 odpowiedzi
+ 2
ok, final try on this. It's really about Windows cmd terminal's default behavior. It can display color but something called VT100 have to be enabled first. A post on stackoverflow have someone discovering that VT100 can be activated by adding this: import os os.system('') I added these two lines to the top of Vitya's code and it worked. But the colors are very bad. Not the same as Vscode's output. Maybe bad implementation by Windows. Additional discussion here: https:bugs.python.org/issue29059 As you can see, the solution the author gave is longer.
15th Nov 2021, 2:26 AM
Bob_Li
Bob_Li - avatar
+ 11
When I wrote "not working", I meant that coloring lines of text wouldn't work in Sololearn playground. I tried this exact code in Linux terminal and had no problem running it. No errors, no additional modules, no imports and no problem what so ever. The problem seems to be caused by lack of some module on the server side or limited functionality of the app. I wonder if there's a solution out there. I've seen a few codes like this one and they run without color either.
10th Nov 2021, 7:45 PM
🇺🇦 Vitya 🇺🇦
🇺🇦 Vitya 🇺🇦 - avatar
+ 10
Bionical Man, sorry for the delay, but let's face it — this method won't work in SL playground. Bob_Li is right. SL runs your code on their servers then they send the result to your simulated console. It's not a real console and it's limited in functionality. However there are other ways to make nice looking output and other aspects of your game you can focus on. Just make a simple working version now. You can always add something later. I'm gonna ask more experienced players on how they make their codes look fancy and support you as well 😉😉. Meanwhile I need to replace my dead phone battery. It popped from likestrorms 😄.
23rd Nov 2021, 5:57 PM
🇺🇦 Vitya 🇺🇦
🇺🇦 Vitya 🇺🇦 - avatar
+ 3
Vitya I need your assistance answering this as you wrote the color table
10th Nov 2021, 7:09 PM
Bionical Man
Bionical Man - avatar
+ 3
Bob_Li Windows CMD Console is that the Windows CMD prompt console. And so I do need to install vscode as vs is not what I need
12th Nov 2021, 12:36 AM
Bionical Man
Bionical Man - avatar
+ 3
Vitya check out Bob_Li I think that may be a solution
12th Nov 2021, 12:37 AM
Bionical Man
Bionical Man - avatar
+ 3
So wait you can right code In window cmd prompt terminal
12th Nov 2021, 12:52 AM
Bionical Man
Bionical Man - avatar
+ 3
Bob_Li I understand now and it's Vitya code
12th Nov 2021, 12:57 AM
Bionical Man
Bionical Man - avatar
+ 3
Bob_Li I still need to look into tweeking the vs terminal so I can get it to work there
13th Nov 2021, 10:21 PM
Bionical Man
Bionical Man - avatar
+ 3
Vitya yah code works on Visual Studio Code Editor
13th Nov 2021, 10:23 PM
Bionical Man
Bionical Man - avatar
+ 2
added ":" at the end of line 6 but it no go here Output Traceback (most recent call last): File "C:\Users\Vic\.conda\envs\env\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Vic\.conda\envs\env\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy\__main__.py", line 45, in <module> cli.main() File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy/..\debugpy\server\cli.py", line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("__main__")) File "C:\Users\Vic\.conda\envs\env\lib\runpy.py", line 267, in run_path The thread 0x1 has exited with code 0 (0x0). code, fname = _get_code_from_file(run_name, path_name) File "C:\Users\Vic\.conda\envs\env\lib\runpy.py", line 242, in _get_code_from_file code = compile(f.read(), fname, 'exec') File "C:\Users\Vic\Desktop\door to freedom file collection\doortofreedom.py", line 7 s1=" ^ SyntaxError: EOL while scanning string literal Traceback (most recent call last): File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy\__main__.py", line 45, in <module> cli.main() File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy/..\debugpy\server\cl
10th Nov 2021, 1:50 AM
Bionical Man
Bionical Man - avatar
+ 2
OK but what is the connection between doortofreedom.py and the Colored Table? Is one part of the other? And do you get the error message when you run just the Colored Table code? I don't see how that could be. At this point there's no way of telling where the issue lies without further information.
10th Nov 2021, 7:06 PM
Simon Sauter
Simon Sauter - avatar
+ 2
In a new project on MICROSFT VISUAL STUDIO terminal i got this output.  Hello World!  0;30;40  0;30;41  0;30;42  0;30;43  0;30;44  0;30;45  0;30;46  0;30;47   0;31;40  0;31;41  0;31;42  0;31;43  0;31;44  0;31;45  0;31;46  0;31;47   0;32;40  0;32;41  0;32;42  0;32;43  0;32;44  0;32;45  0;32;46  0;32;47   0;33;40  0;33;41  0;33;42  0;33;43  0;33;44  0;33;45  0;33;46  0;33;47   0;34;40  0;34;41  0;34;42  0;34;43  0;34;44  0;34;45  0;34;46  0;34;47   0;35;40  0;35;41  0;35;42  0;35;43  0;35;44  0;35;45  0;35;46  0;35;47   0;36;40  0;36;41  0;36;42  0;36;43  0;36;44  0;36;45  0;36;46  0;36;47   0;37;40  0;37;41  0;37;42  0;37;43  0;37;44  0;37;45  0;37;46  0;37;47   1;30;40  1;30;41  1;30;42  1;30;43  1;30;44  1;30;45  1;30;46  1;30;47   1;31;40  1;31;41  1;31;42  1;31;43  1;31;44  1;31;45  1;31;46  1;31;47   1;32;40  1;32;41  1;32;42 [1
11th Nov 2021, 2:41 PM
Bionical Man
Bionical Man - avatar
+ 2
I use Sololearn playground as a practice field or a place to work out a code and if it doesn't appear to work on Sololearn playground I also use the Decoder app I use. And if that doesn't work I know understand it's because they aren't actual terminals so I use the Visual Studio not the Visual Studio Code as an editor not a IDE. I imagine the problem is simple I am not using a python ide but code editor. any suggestions on a good ide. here is the website about visual studio code https://www.microsoft.com/en-ca/resilience/remote-development-solutions/?&ef_id=CjwKCAiAm7OMBhAQEiwArvGi3OPwFCGQ1_i_V-x32eVntiuO63zFenp9o4J2iD6SHMEXKnt8zH1dhxoCZbUQAvD_BwE:G:s&OCID=AID2201104_SEM_CjwKCAiAm7OMBhAQEiwArvGi3OPwFCGQ1_i_V-x32eVntiuO63zFenp9o4J2iD6SHMEXKnt8zH1dhxoCZbUQAvD_BwE:G:s&gclid=CjwKCAiAm7OMBhAQEiwArvGi3OPwFCGQ1_i_V-x32eVntiuO63zFenp9o4J2iD6SHMEXKnt8zH1dhxoCZbUQAvD_BwE
11th Nov 2021, 2:58 PM
Bionical Man
Bionical Man - avatar
+ 2
if you're working in windows, support for colored text in cmd terminal is not so great. Your example works fine in my vscode terminal, but does not work when I run it from Windows cmd console. Using modules like colorama can get cmd to display color, though the colors are muddy and not quite the same.
12th Nov 2021, 12:30 AM
Bob_Li
Bob_Li - avatar
+ 2
oh, yes, Vitya's code. Been doing some Google searches. Perhaps you can tweak which terminal to use in Visual Studio. https://devblogs.microsoft.com/visualstudio/say-hello-to-the-new-visual-studio-terminal/ Worth a try.
12th Nov 2021, 6:41 AM
Bob_Li
Bob_Li - avatar
+ 2
Vitya Bob_Li can I use a color table like this to organize the character profiles for the 2 Playable characters in my game all the info are string info
15th Nov 2021, 3:21 PM
Bionical Man
Bionical Man - avatar
+ 2
@vita I know I have real Consol code software I use. I hope this now makes sense. I only us SL A as a study tool not as a programming tool
23rd Nov 2021, 6:01 PM
Bionical Man
Bionical Man - avatar
+ 2
23rd Nov 2021, 6:02 PM
Bionical Man
Bionical Man - avatar
+ 1
I did in a post as that is the only what I know how
10th Nov 2021, 1:17 AM
Bionical Man
Bionical Man - avatar