How do you add images?
so i want to make it so that they search for something and the definition appears with an image as well. I don't know if this is possible. thanks
You can put an image into the terminal using a program called TerminalImageViewer.
Insert this into the beginning of your code:
import os os.system("wget https://raw.githubusercontent.com/stefanhaustein/TerminalImageViewer/master/src/main/java/TerminalImageViewer.java -q -O TerminalImageViewer.java") file = open("TerminalImageViewer.java") lines = file.readlines() lines = ' " - When multiple files are supplied, -c sets the number of images per row (default: 4)." + ' file = open("TerminalImageViewer.java","w") file.writelines(lines) file.close() os.system("javac TerminalImageViewer.java") os.system("clear")
This will download the program, fix a typo, and compile it.
To view an image, run:
os.system("java TerminalImageViewer [image]")
Replace [image] with the filename of the image you want to open.
Its not the highest resolution, but at least you can see what is in the image.
If you want to test it, go to https://repl.it/@UniqueOstrich18/Terminal-Image-Test#main.py
Btw if you don't want the "starting x" text to appear, download a blank png file from https://commons.wikimedia.org/wiki/File:Blank.png#/media/File:Blank.png, upload it to your repl and put this code after first one:
os.system("java TerminalImageViewer Blank.png") os.system("clear")
You can't have images in a console application, but you can put a link to an image that the user can then click to view in a new tab. Just print the image URL and Repl.it will automatically make it into a clickable link.
Two ways to do it, ith right click on an image you want, click copy image, then paste it in here -