Study/Python (2) 썸네일형 리스트형 [Python] Folder / File 1. 폴더1) 폴더 내 파일 목록 조회import ospath = 'C:\\_TEST_'files = os.listdir(path)print(files)- 해당 경로 안의 모든 파일 목록을 리스트로 반환 2) 폴더 유무 확인 후 폴더 생성import ospath = 'C:\\_TEST_\\_1_'if not os.path.isdir(path): os.makedirs(path) 3) 폴더 복사import shutilpath_src = 'C:\\_TEST_\\_1_'path_dest = 'C:\\_TEST_\\_2_'shutil.copytree(path_src, path_dest)- path_src 가 파일인 경우 오류 발생- path_dest 경로에 이미 폴더가 존재하는 경우 오류 발생 4) 폴더 삭.. [Python] tkinter 1. Labelimport tkinter as tkfrom tkinter import ttkwindow = tk.Tk()window.title('Label')window.geometry('300x200')label = ttk.Label(window, text='Label Test')label.pack()window.mainloop() 2. Buttonimport tkinter as tkwindow = tk.Tk()window.title('Button')window.geometry('300x200')button = tk.Button(window, text='Button Test', width=20, height=2)button.pack()window.mainloop()- 버튼 색 변경import tkint.. 이전 1 다음