Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7
I think Sololearn has made their batch script to look for a .png extension and then alter the terminal characteristics, or something, so that it fits the display. Here is my observation: I made a Python test version of my VT Hanoi program that prints ASCII snapshots between animation steps. On my phone the output ends up wrapping the 80-column lines and looks bad. Now if I import os and issue a command that creates an empty .png file (merely using "touch ping.png"), suddenly I get a horizontally scrollable window with my output looking as it was intended. Also it adds an icon at the end indicating the image could not be displayed (naturally, since I did not create an image). https://code.sololearn.com/cVd8LJZ6kxku/?ref=app Comment out the last two lines to see the difference.
16th Feb 2021, 11:01 PM
Brian
Brian - avatar
+ 5
New discovery. We can use the pypng module to create PNG files and display them in Sololearn Python codes! https://code.sololearn.com/cA22A18A24a1/#py
17th Feb 2021, 2:42 PM
Tibor Santa
Tibor Santa - avatar
+ 4
18th Feb 2021, 2:55 PM
Ishmam
Ishmam - avatar
+ 3
Also we can pull any PNG image from the internet to display (any potentially manipulate!) in Sololearn :) https://code.sololearn.com/ca17a919A108/#py
17th Feb 2021, 3:43 PM
Tibor Santa
Tibor Santa - avatar
+ 3
Another new discovery. Animated GIFs work, too! https://code.sololearn.com/c10iqZtr0FJw/?ref=app [Thanks, Tibor Santa for the use of your code to pull images from URLs]
17th Feb 2021, 4:26 PM
Brian
Brian - avatar
+ 2
your codes don't show image; Only write "no out put"
16th Feb 2021, 5:13 AM
°∆_/A.H.B.Y\_∆°
°∆_/A.H.B.Y\_∆° - avatar
+ 2
You just change the extension name for it to work.
17th Feb 2021, 11:48 AM
Venus Nangorog
Venus Nangorog - avatar
+ 2
Breakthrough! Here is VT Hanoi with full animation. I am thrilled to see this old terminal program of mine come to life again. Thanks to Jan Markus and Tibor Santa for developing techniques that I borrowed to make it possible. https://code.sololearn.com/cny2exUQ1N8M/?ref=app
18th Feb 2021, 11:46 AM
Brian
Brian - avatar
+ 1
Ok
17th Feb 2021, 8:26 AM
lotfali.ir
lotfali.ir - avatar