Counting consecutive streaks in random numbers
If your program is going to be run via cli only, then I'd suggest that you look into argparse library.
Split the code snippet into different functions. Though your current use-case is limited, but suppose you later want to check successive outcomes in a 6 face die? A 10 face die? A 20 face die? I'd suggest asking for number of faces as an argparse param, and default it to 2.
Use the logging library's RotatingFileHandler to control logging to the files.
In the logic, you do not need to store the value of random_number_before. Just checking against a constant value of 1 would suffice in your case:

if random_number == 1:
    actual_succession += 1
else:
    if actual_succession &gt; longest_succession:
        longest_succession = actual_succession
    actual_succession = 0


as the logic is executed for each iteration of the counter, everytime you encounter a number other than 1, your succession counter would be reset to 0.