'Why won't my Python program run outside of IDLE? [closed]

I'm making a hangman game to get more familiar with Python, and I decided to implement reading text files to get death messages etc. Since I added this sub program, the program closes as soon as this sub program is called.

def life_loss_messages_create():
    p_life_loss_messages = []
    life_loss_messages_file = open("life_loss_messages.txt", "r")

    for message_line in life_loss_messages_file:
        message_line.strip()
        this_line = message_line.split("-")
        p_life_loss_messages.append(this_line)
    life_loss_messages_file.close()

    return p_life_loss_messages

Why will this not run past this sub program outside of IDLE? If opened and ran with IDLE it works fine, but not if double clicked and ran itself.



Solution 1:[1]

Try putting whole directory there, not just filename.

Solution 2:[2]

Can you be more specific on your question. I noticed your css is top:6px;

try to put bottom:6px; your position is relative (try absolute) as well or

transform-origin: bottom left 0px;

I am not sure if this answer your question but hopefully this can help. You usually put the div or your paragraph at the bottom part of your html so it is at the bottom part. I am really guessing on what you want to happen but if you give more specifics I will be able to help you on what you want.

Solution 3:[3]

Try to add this lines

.socials-email a {
        font-family: 'Times New Roman', Times, serif;
        font-weight: bold;
        font-size: 18px;
        color: #25374C;
        position: fixed;
        bottom: 1%;
        text-decoration: none;
    }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dod0lp
Solution 2 Crystal
Solution 3