[Python] Using text.rfind() to read emails

Discussão em 'Python' iniciado por Stack, Maio 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am looking for this line of code to read the next 7 characters after finding 'The below guest has contacted Guest Support about an issue at restaurant '. This first part of the code works great, but the tutorial I was following has the second part of that line of code read all the way to the next line. It is way too much data that I just don't need to see.

    enter image description here

    The line of code i am having trouble with:

    PC = text[text.rfind('The below guest has contacted Guest Support about an issue at restaurant ')+73:text.rfind('Case Number: ')]

    Continue reading...

Compartilhe esta Página