Click here to Skip to main content
15,868,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
from Tkinter import *
Python
import shutil
class App(Frame):
    def __init__(self, master):
        Frame.__init__(self, master)
        
        self.kill()
    def kill(self):
        self.a = Label(self, text = "file copier2")
        self.a.grid(row = 0, column = 0, sticky = W)
        self.b = Entry(self)
        self.b = Label(self, text = "please enter the file that the contents should be copied to")
        self.b.grid(row = 1, column = 0)
        self.c = Entry(self)
        self.c.grid(row = 1, column = 1)
        self.dst = self.c.get()
        self.d = Label(self, text = "please enter the file that contains the contents")
        self.d.grid(row = 2, column = 0)
        self.e = Entry(self)
        self.src = self.e.get()
        shutil.copyfile(self.src, self.dst)

root = Tk()
root.geometry("200x50")
root.title("file copier v2")
app = App(root)
root.mainloop()

the error:

Traceback (most recent call last):
  File "C:/Python27/file copier v2.py", line 26, in <module>
    app = App(root)
  File "C:/Python27/file copier v2.py", line 7, in __init__
    self.kill()
  File "C:/Python27/file copier v2.py", line 21, in kill
    shutil.copyfile(self.src, self.dst)</module>
Posted
Updated 5-Jan-15 0:02am
v2
Comments
Member 11352783 5-Jan-15 5:48am    
my name is govind and i am getting this error when i use shutil to move files and Tkinter for GUI interface
Richard MacCutchan 5-Jan-15 6:33am    
What is the error message, all you have shown is the Traceback?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900