import os
import sys
def resource_path(relative_path):
if getattr(sys, 'frozen', False):
base_path = sys._MEIPASS
else:
base_path = os.getcwd()
return os.path.join(base_path, relative_path)
print(resource_path("HelloWorld.txt"))
import shutil
import getpass
shutil.move(resource_path("HelloWorld.txt"), "C:\\Users\\" + getpass.getuser + "\\Desktop")