私はpythonの初心者であり、自分のプログラムに自分のやりたいことをさせることができないようです。ユーザーが開きたい.gifファイルを指定すると、プログラムは指定したファイルを表示し.gif
ます。私が間違っているのかわかりません。誰かが私を助けてくれれば、とても感謝しています。ファイルを指定してもらいたいので、プログラムはファイルの名前をフォルダー内の「変数」に変更します。"variable.gif"
呼び出されたファイルを開く/path/path/variable.gif
files = listdir(".")
print("List of GIF files in Directory:")
for f in files:
if f[-4:] == ".gif":
print(f)
print("type quit to close the program")
gif1 = input("type which .gif you would like to modify and press enter:")
infile = open(gif1, "r")
outfile= open("gif1.gif", "w")
os.system('eog {0}'.format(r'home/pictures/gif1'))