-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilecontroler.py
More file actions
30 lines (28 loc) · 809 Bytes
/
Copy pathfilecontroler.py
File metadata and controls
30 lines (28 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from tkinter import *
import os
import easygui
import shutil
from tkinter import filedialog
from tkinter import messagebox as mb
r = Tk()
def window_open():
read = easygui.fileopenbox()
return read
def copy_file():
x = window_open()
y = filedialog.askdirectory()
shutil.copy(x, y)
mb.showinfo('conformation','file copied!')
def move_file():
x = window_open()
y = filedialog.askdirectory()
shutil.move(x, y)
mb.showinfo('conformation','file moved!')
def remove_file():
x = window_open()
os.remove(x)
mb.showinfo('conformation','file removed!')
Button(r, text = 'copy file',command = copy_file).grid(row = 21, column = 2)
Button(r, text = 'move file',command = move_file).grid(row = 22, column = 2)
Button(r, text = 'remove file',command = remove_file).grid(row = 23, column = 2)
r.mainloop()