May-29-2020, 11:14 AM
Hello, everybody!
I have run into a spot of bother while writing my Python script and I am wondering if anyone can help me out.
I am trying to read a text file using Python. That goes well and I am able to read the file line-by-line (using the File_Object.readline() function), which is my goal. However, to make my file more organized, I do this, for example my first line:
I want to use "John" only as a variable, and I don't want to read the first 7 bytes of the line: "name = "
I only want to read "John".
Is there anyway I am able to do this? I also want to add that the variable after "name = " is randomised and may not always be "John". I just need to ignore the "name = ". Thank you.
I have run into a spot of bother while writing my Python script and I am wondering if anyone can help me out.
I am trying to read a text file using Python. That goes well and I am able to read the file line-by-line (using the File_Object.readline() function), which is my goal. However, to make my file more organized, I do this, for example my first line:
Quote:name = John
I want to use "John" only as a variable, and I don't want to read the first 7 bytes of the line: "name = "
I only want to read "John".
Is there anyway I am able to do this? I also want to add that the variable after "name = " is randomised and may not always be "John". I just need to ignore the "name = ". Thank you.