/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
/ÖÐÎÄ/
±¾µØGIFͼÉú³ÉÍøÒ³Ô¤ÀÀ¹¤¾ßÊÇÒ»¿î·Ç³£²»´íµÄͼÏñÔ¤ÀÀÈí¼þ£¬Äܹ»°ïÖúÓû§¿ìËÙÉú³ÉÎļþÖеÄͼƬԤÀÀЧ¹û£¬¿ÉÒÔÒ»ÏÂ×ÓÔ¤ÀÀÈ«²¿µÄ¶¯Ì¬Í¼£¬Ê¹ÓÃÆðÀ´·Ç³£·½±ãÓÐÐèÒªµÄÓû§²»Òª´í¹ýÁË£¬¸Ï¿ìÀ´ÏÂÔØ°É£¡
µçÄÔÀïÓкܶàGifͼ, µçÄÔµÄËõÂÔͼֻÄÜÉú³É¾²Ö¡µÄÔ¤ÀÀͼ,¶ø¿ÉÒÔͨ¹ýÕâ¸öÉú³É¸öÍøÒ³,¿ÉÒÔÒ»ÏÂ×ÓÔ¤ÀÀÈ«²¿µÄ¶¯Ì¬Í¼ÁË. µ±È»,Ò²Óиö±×¶Ë,Ò»´Î¼ÓÔØ´óÁ¿µÄgifµ½ÍøÒ³ÉÏ, »áÌرðÌرðÕ¼ÄÚ´æ,¾ÍÐèÒªÒ»¸ö´óÄÚ´æ.²»¹ýÕⶼ2021ÄêÁË.Ë»¹Ã»¸öÊ®¼¸¶þÊ®¼¸´ó¼¸Ê®¼¸µÄÄÚ´æàÏ?
²»¹ýÄúÄÚ´æÒªÊÇÕæµÄû¶à´ó(±ÈÈçµçÄÔ4gÄÚ´æ,2gÄÚ´æ), Ò»¶¨É÷ÖؼÓÔس¬¶àͼƬ!!!
Õâ´ÎµÄ´´Òâ. À´×Ô»ñÈ¡ÁËÒ»¶ÑGifºó,ÀÁ×ÅÀÁ×ÅͻȻÓеÄÁé¸Ð!...Õâ´ÎÈí¼þÌرðºÃд, ÒªÊÇÓÐÐǪ̈ÏëÄ£·Â»òÕ߶þ´Î´´×÷, ÇëÒ»¶¨Òª°¬ÌØÎÒßÏ!!!֮ǰÎÒдµÄһЩԴ´, ÓÐЩ±»ÈËÄ£·ÂÈ¥ÁË, Ȼû¼û°¬ÌØÎҵľͺÜÓôÃÆ..Óа¬ÌصÄÎҵľͳ¬¿ªÐÄ!
import os
import traceback
def makeweb(xpath):
filespath=""
contentfiles=[]
try:
list_dirs = os.walk(xpath)
for root, _dirs, files in list_dirs:
for f in files:
f=f.lower()
bool1 = f.endswith(".gif")
bool2 = f.endswith(".jpg")
bool3 = f.endswith(".png")
bool4 = f.endswith(".bmp")
if bool1 or bool2 or bool3 or bool4:
shortpath=root[len(xpath)+1:len(root)]
if len(shortpath)>0:
filespath=shortpath+"\\"+f
contentfiles.append(filespath)
else:
filespath=f
contentfiles.append(filespath)
if len(contentfiles)>0:
effecttype = os.path.basename(xpath)#´øºó׺µÄÎļþÃû
#effecttype="»ðÑæ"
filename = xpath+'\\'+effecttype+'.html'
with open(filename, 'w',encoding="utf-8") as file_object:
file_object.write("<!DOCTYPE html>\n")
file_object.write("<html>\n")
file_object.write("<title>"+effecttype+"</title>\n")
file_object.write("<style type=\"text/css\">.left{float: left;}.pic {/*max-width: 300px;height:auto;*/max-height: 130px;width: auto;} </style>\n")
file_object.write("<head><link rel=\"icon\" type=\"image/x-icon\" href=\""+contentfiles[0]+"\" /></head>\n")
file_object.write("<body>\n")
file_object.write("<h5>¿ÉÒÔ°´×¡Ctrl + Êó±ê¹öÂÖ ·Å´óËõСҳÃæ,Ctrl + 0 ÖØÖÃÒ³Ãæ</h5>\n")
file_object.write("<h5>"+effecttype+"·ÖÀà</h5>\n")
for i in contentfiles:
file_object.write("<div class=\"left\"><a href=\""+i+"\" target=\"_blank\"><img class=\"pic\" src=\""+i+"\" ></a></div>\n")
file_object.write("</body>\n")
file_object.write("</html>\n")
else:
print("Ä¿±êÎļþ¼ÐÀïûÓÐͼƬÎļþ(bmp,jpg,png,gif),ÇëÑ¡ÔñÒ»¸öÓÐÕâЩͼƬÀàÐ͵ÄÎļþ¼ÐºóÖØÐÂÉú³ÉÍøÒ³")
return False
totalpath=xpath+"\\"+effecttype
totalpath=totalpath.replace("\\\\","\\")
print(totalpath+".html ÍøÒ³ÖÆ×÷Íê³É")
os.system("explorer /select, "+'\"'+filename+'\"')
except Exception as _ex:
print("³ÌÐò³öÏÖ´íÎó,Çë°ÑÏÂÃæµÄ´íÎó¸´ÖƸøÖÆ×÷ÕßÓÃÓÚÐÞ¸Ä,лл!")
print("--------------------------------------------------------")
print('traceback.format_exc():\n%s' % traceback.format_exc())
print("--------------------------------------------------------")
print(effecttype+"ÍøÒ³ÖÆ×÷ʧ°Ü,ÇëÁªÏµÖÆ×÷Õß")
if __name__ == '__main__':
print("ͼƬÉú³ÉÍøÒ³Ô¤ÀÀ(gif,png,bmp,jpg) Îá°®ÆƽâÂÛ̳ 52pojie.cn")
path=input("ÇëÕ³Ìù»òÕßÍÏקһ¸öͼƬÎļþ¼ÐµÄ·¾¶,ÓÃÀ´Éú³ÉÍøÒ³:\r\n")
while True:
path=path.replace("\"", "")
if os.path.exists(path):
bool1 = path.endswith("\\")
if bool1:
path=path.strip('\\')
makeweb(path)
else:
print("Ä¿±êÎļþ¼Ð²»´æÔÚ,ÇëÖØÐÂÑ¡ÔñÒ»¸öÓÐЧµÄÎļþ¼ÐÀ´Éú³ÉͼƬÍøÒ³")
path=input("±¾´Î²Ù×÷Íê±Ï,¼ÌÐø²Ù×÷ÇëÔÙ´ÎÕ³Ìù»òÕßÍÏקһ¸öͼƬÎļþ¼ÐµÄ·¾¶,½áÊøÇëÖ±½Ó¹Ø±Õ±¾´°¿Ú:\r\n")
¹ØÓÚÌÚÅ£ | ÁªÏµ·½Ê½ | ·¢Õ¹Àú³Ì | °æȨÉùÃ÷ | ÏÂÔØ°ïÖú(£¿) | ¹ã¸æÁªÏµ | ÍøÕ¾µØͼ | ÓÑÇéÁ´½Ó
Copyright 2005-2024 QQTN.com ¡¾ÌÚÅ£Íø¡¿ °æȨËùÓÐ ¶õICP±¸2022005668ºÅ-1 | ¶õ¹«Íø°²±¸ 42011102000260ºÅ
ÉùÃ÷£º±¾Õ¾·ÇÌÚѶQQ¹Ù·½ÍøÕ¾ ËùÓÐÈí¼þºÍÎÄÕÂÀ´×Ô»¥ÁªÍø ÈçÓÐÒìÒé ÇëÓë±¾Õ¾ÁªÏµ ±¾Õ¾Îª·ÇÓ®ÀûÐÔÍøÕ¾ ²»½ÓÊÜÈκÎÔÞÖúºÍ¹ã¸æ