Ask coding questions

← Back to all posts
how to run a .gif
CholsreaMMOS

I'm trying to run a gif to my python program, but I've searched everywhere and cant find out how to do it.

Answered by 19wintersp [earned 5 cycles]
View Answer
Voters
MoizSheikh6969
Maciej1234
CholsreaMMOS
Comments
hotnewtop
19wintersp

run a gif

What do you mean? You can't "run" an image.

CholsreaMMOS

@19wintersp i meant try to get it to visualize

19wintersp

@CholsreaMMOS You can use the bash command xdg-open:

It's the equivalent of running explorer wave.gif if you're on Windows; it opens the file in the default application for that filetype.
More information

CholsreaMMOS

@19wintersp is there another form of that. i tried but it didn't run the gif it only showed the first frame

19wintersp

@CholsreaMMOS Oh dear, I don't think feh (the default image viewer) animates them. Sorry, I don't know of another way, though you might find this useful.

CholsreaMMOS

@19wintersp ok thanks any way. it looks like it won't work on repl because it requires you to download packages and import them into python. but again, thanks

RYANTADIPARTHI

Solution

You can't run an image, or a gif in the console. python doesn't support that. but flask and django do, they are just web frameworks of python. but the python console doesn't support images or gifs.

CholsreaMMOS

@RYANTADIPARTHI ok ill try it, how do i get to them, just google it them?

A possible alternative is a .gif to a "website link" but couldn't find any ot figure out how to add a link in terminal

RYANTADIPARTHI

@CholsreaMMOS what do you mean by get to them? like i said, python console doesn't support it.

CholsreaMMOS

@RYANTADIPARTHI get to flask or django

RYANTADIPARTHI

@CholsreaMMOS flask and django are programming languages.

19wintersp

@RYANTADIPARTHI What? Flask and Django are frameworks which run on Python, not languages themselves.

RYANTADIPARTHI

@19wintersp if you refer to my first comment. you would get the same exact information of what you said.

19wintersp

@RYANTADIPARTHI Yes, what you said at the start is correct, but that contradicts what you said later:

flask and django are programming languages

Never mind

CholsreaMMOS

i managed to find a website to use to get a link that i can add to the code, thanks for all of your help!

[deleted]

A gif is an image file, not a Python script.

CholsreaMMOS

@LucasAllori yeah i know. Thought it might be displayable in console

[deleted]

@CholsreaMMOS It is not displayable in a console.

CholsreaMMOS

@LucasAllori ok thanks for thee help

[deleted]

@CholsreaMMOS np i guess