You can open a file by using the open method. For example, you could do
external_code = open("src/external_path.txt")
... and get the text inside of the file by doing...
text = external_code.read()
Because it returns the string, you will need to parse the data from it.
For the parsing, I am unsure what would the best route for it. You could split the string different keywords and set your variable based on what number resides with the keyword...
Also, you may want to include more information next time you post; people tend to get a little annoyed with it. :/
I have a text file with lines like this one:
Cubo: 100% (left_x:  744   top_y:  395   width:  167   height:  181)
I would like to assign the appropiate int for each one of the variables, something like: left_x = 744, top_y = 395, width = 167, height = 181 but without having to do it manually.
how do I find and get text from a text file in python?