How do I treat strings separated by spaces in text files?

easiest way is to split on space

with open("Text.txt", mode="r") as file:
    encryptedtext, key = file.readline().split(' ')