Skip to content

Instantly share code, notes, and snippets.

@wlhunag
Last active August 29, 2015 14:12
Show Gist options
  • Save wlhunag/77de57e96853eb512adf to your computer and use it in GitHub Desktop.
Save wlhunag/77de57e96853eb512adf to your computer and use it in GitHub Desktop.
Tkinter folder
# -*- coding: utf-8 -*-
import os
from Tkinter import *
def get_entry():
print e1.get()
#按下按鈕後會建立資料夾
os.mkdir(e1.get())
master = Tk()
Label(master, text="Folder Name").grid(row=0)
e1 = Entry(master)
e1.grid(row=0, column=1)
Button(master, text='Get', command=get_entry).grid(row=2, column=1, sticky=E)
#因為原本 input text 沒有內容,所以不能用來建立資料夾
#os.makedirs(e1.get())
mainloop( )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment