Execute script without opening MT5 window

 

Hello, 

I created a little script script with Python with this function: 

def connectToAccount(account, pswd):
        # if not mt5.initialize():
        #       print("initialize() failed, error code =", mt5.last_error())
        #       quit()

        authorized = mt5.login(account, psw)
        if authorized:
                        print("Connected to account #{} ".format(account))
        else:
                print("failed to connect at account #{}, error code: {}".format(
                        account, mt5.last_error()))

And I don't find a way to connect to an account without opening or some tricks. 

I would like to connect without MT5 window. 

Do you have any tracks or solution ?


Thank you  !