#單獨獲取當前目錄名 import os def name(): return os.path.split(os.getcwd())[-1] #WIN關閉一個進程 import ctypes def kill(pid): """kill function for Win32""" kernel32 = ctypes.windll.kernel32 handle = kernel32.OpenProcess(1, 0, pid) #使用termina函數結束進程 return (0 != kernel32.TerminateProcess(handle, 0))