Python: User input directories access

I wrote a python program to synchronies one of my source files directory. The program takes in user input of the directory to be used. When I run the code from within VS code, the program can access the directories.

I’m on a Mac, so this would be the one of the users input: /Users/dennis/Desktop/Phonenix Enigma Distro

But, when I try to run the program from a terminal, it can’t find the directory. The code for the program is in my document directory: /Users/dennis/Documents/Python/Projects/Python backup software

Here is the code that takes the user input and then verifies the directory;

def Get_Run_Parms():
    # The program accepts run time parameters or user input.

    global line

    def Print_Help():
        # Print put help if need be

        os.system('Clear')

        print(f"SyncSource version {ver} Program help.n")
        print("-s=<source directory to search>.")
        print(f"-t=<target directory to copy file to.n")
        print("Example:")
        print(" SourceUpdate.py -s='source/directory' -t='target/directory'")
        print()
        print(" SourceUpdate.py -h   prints this help menu.")
        print()
        print(f'If no run time parms are present, the program will ask for user input.n')

    # Check for run time parms
    args = sys.argv[1:]
    print(f'nNumber of parms entered: {len(args)} Parms: {args}n')
    line += f'nNumber of parms entered: {len(args)} Parms: {args}n'

    # If 0 run time parms, ask the user for input
    if len(args) == 1:
        Print_Help()
        sys.exit()

    if len(args) != 2:
        print('No run time parms entered, please supply the following;')
        line += f'No run time parms entered, please supply the following;n'

        # Ask for source, if no source, bow out.
        source = input(f'nEnter source directory: ')
        line += f'Enter source directory: User Entered: {source}n'
        if not os.path.exists(source):
            print(f'Source directory {source} not found.n')
            line += f'Source directory {source} not found.n'
            line += f'Program ended.n'
            sys.exit(f'Program Ending.n')
        else:
            print(f'Source directory {source} validated.n')
            line += f'Source directory {source} validated.n'

        # Ask for target, if no target, ask to create or bow out.
        target = input(f'Enter target directory: ')
        line += f'Enter target directory: User Entered: {target}n'
        if not os.path.exists(target):
            print(f'Target directory {target} not found.n')
            line += f'Target directory {target} not found.n'
            a = input('Would you like to create this directory? ')
            line += f'Would you like to create this directory? User Entered: {a}n'
            if a in ['Yes','yes','Y','y']:
                print(f"Creating directory {target}n")
                line += f"Creating directory {target}n"
                os.makedirs(target)
            else:
                line += f'Program ended.n'
                sys.exit(f'Program Endingn')

        else:
            print(f'Target directory {target} validated.n')
            line += f'Target directory {target} validated.n'
    else:
        for i in args:

            # Check for source, no source, bow out
            line += f"{i[:3]} {i[:3]}n"
            if i[:3] == '-s=' or i[:3] == '-S=':
                source = str(i[3:])
                if not os.path.exists(source):
                    print(f'Source directory {source} not found.n')
                    line += f'Source directory {source} not found.n'
                    line += f'Program ending.n'
                    sys.exit(f'Program Endingn')
                else:
                    print(f'Source directory {source} validated.n')
                    line += f'Source directory {source} validated.n'

            # Check for target, no target as to create or bow out.
            elif i[:3] == '-t=' or i[:3] == '-T=':
                target = str(i[3:])
                if not os.path.exists(target):
                    print(f'Target directory {target} not found.n')
                    line += f'Target directory {target} not found.n'
                    a = input('Would you like to create this directory? ')
                    line += f'Would you like to create this directory? {a}n'
                    if a in ['Yes','yes','Y','y']:
                        print(f"Creating directory {target}n")
                        line += f"Creating directory {target}n"
                        os.makedirs(target)
                    else:
                        line += f'Program ending.n'
                        sys.exit(f'Program Endingn')
                else:
                    print(f'Target directory {target} validated.n')
                    line += f'Target directory {target} validated.n'
            else:
                Print_Help
                sys.exit()

    return source, target

I’m new to python, so the program may not be up to a lot of peoples standards. So, what am I missing? Do I need to set the working dorectory to the root first? Am I inputting the directory incorrectly?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật