资源简介
基于psd_tools 与win32file
代码片段和文件信息
import os
import sys
from psd_tools import PSDImage
import win32file
import win32con
from time import sleep
def file_extension(path):
return os.path.splitext(path)[1]
def get_file_extension(path):
return os.path.splitext(path)[0]+‘.jpg‘
def thumbs(file):
exts = file_extension(file)
exts = exts.lower()
file_name = get_file_extension(file)
print(exts)
if(exts == ‘.psd‘):
sleep(3)
print(1)
im = PSDImage.load(file)
im.header
print(im.header)
layer = im.as_PIL()
layer.save(file_name)
print(file_name)
ACTIONS = {
1: “Created“
2: “Deleted“
3: “Updated“
4: “Renamed from something“
5: “Renamed to something“
}
FILE_LIST_DIRECTORY = 0x0001
path_to_watch = ‘H:/ftps‘
print(‘Watching changes in‘path_to_watch)
hDir = win32file.CreateFile(
path_to_
- 上一篇:利用Python将照片在Excel中利用点阵图显示
- 下一篇:学员管理系统源码
评论
共有 条评论