shutil.copy隐藏文件

时间:2018-05-20 13:38:50

标签: python windows python-3.x shutil

from shutil import copy
import os

print("Preparation: put 3 followpoint files in your skin's folder; followpoint.png, followpoint@2x.png, and followpointblank.png. I think these names are self explanatory enough.")
thingything = input("Enter your animation pattern (. = blank, - = line) (example: ...------..): ")
inputs = list(thingything)

for i in range(len(inputs)):
    if inputs[i] == ".":
        copy("followpointblank.png", "followpoint-" + str((i + 1)) + ".png")
    if inputs[i] == "-":
        copy("followpoint.png", "followpoint-" + str((i + 1)) + ".png")
        copy("followpoint@2x.png", "followpoint-" + str((i + 1)) + "@2x.png")

os.remove("followpoint.png")
os.remove("followpoint@2x.png")
os.remove("followpointblank.png")

每当我尝试运行此程序时,它最终会使用Windows 10命名文件.followpoint-1.png而不是followpoint-1.png。我不想要这个。

0 个答案:

没有答案