Good Day
I have currently developed a piece of code that copies files from one location to another. I am currently trying to specify a specific static IP address instead of using a dynamic drive letter that changes from PC to PC.
Currently my code is as follows:
import glob
import os
import shutil
import easygui
def copy(src):
destination = easygui.diropenbox()
list_of_files = glob.glob(src) # * means all if need specific format then *.csv
latest_file = max(list_of_files, key=os.path.getctime)
shutil.copy(latest_file, destination)
copy('C:\Users\micha\Desktop\Test_Copy1\*')
Instead of using copy('C:\Users\micha\Desktop\Test_Copy1\*')
I was thinking of using something like this: \\ip-address\Users\micha\Desktop\Test_Copy1\*
. I have tried using this link UNC however this would mean I would have to get around a login page in the code which I have no clue how to do.
If anyone can help it would be much appreciated.