How can I read a single character at a time?

How can I read just one character at a time?

From what?

I figured it out: f.read(1).

Hello,

here is simple example of reading a character from an existing string, one at a time:

my_string = "This is a generic string."

print(f'Read character at position my_string[2]: "{my_string[2]}"\n')  # character at position 2 from the first character

# Or all characters via a for loop

for char in my_string:
    print(f"Read a character from my_string: '{char}'")