[問題] tkinter 用輸入的變數建立資料夾

看板Python作者 (廷)時間9年前 (2015/01/02 23:13), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
如題,最近才剛開始練習python,之前也沒其它程式的經驗, 所以目前非常的菜,想問各位,我想在要用我輸入的名稱, 並且在同個目錄下建立資料夾,網路上找到的都是教怎麼建立選單, 沒有找到要如何把變數傳回建立資料夾,我的程式如下, 目前是可以print 出我輸入的值,但是建立資料夾的部份會有問題, 不知該如何改才行,謝謝各位大大。 ******************************************************* import os from Tkinter import * def get_entry(): print 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) os.makedirs(e1) mainloop( ) ****************************************************** -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.239.132.33 ※ 文章網址: http://www.ptt.cc/bbs/Python/M.1420211585.A.B15.html

01/03 21:30, , 2F
感謝!我試試看
01/03 21:30, 2F
文章代碼(AID): #1KfhM1iL (Python)