Python problems đŸ–Ĩī¸

C_S_M

Well-known member
  • May 8, 2023
    3,153
    3,545
    113
    Kandy
    I saved my python project as a py file. When i trying to open it flashes then disappear. How to fix it?
     
    Last edited:
    • Like
    Reactions: siri_ayya

    siri_ayya

    Well-known member
  • Feb 1, 2022
    16,966
    1
    29,883
    113
    Try running in the terminal like "py <ur file name>.py"

    If that also doesn't work, post the code..
     
    • Like
    Reactions: C_S_M

    gnilukshi

    Well-known member
  • Oct 9, 2008
    25,080
    48,513
    113
    āļšāˇ āļ¸āˇ’āļ§āˇŠāļ§āˇœ āļšāˇāļŠāˇŠ āļ‘āļš

    āļšāˇāļŠāˇŠ āļ‘āļš āļąāˇāļ­āˇ”⎀ āļ…āļ´āˇ’ āļšāˇœāˇ„āˇœāļ¸āļ¯ āļŠāˇ’āļļāļœāˇŠ āļšāļģāļąāˇŠāļąāˇš
     

    Honey Bunch

    Well-known member
  • Nov 24, 2018
    16,973
    26,386
    113
    Kandy
    open cmd and change directory to containing your source code
    suppose if it in drive D
    type D:
    then use dir command to list directory
    then type cd your directory
    then type python yourfile.py or if you are using python3
    python3 yourfile.py

    better to use pycharm ide
    ------ Post added on May 8, 2023 at 1:34 PM
     
    • Like
    Reactions: C_S_M and EdNygma

    C_S_M

    Well-known member
  • May 8, 2023
    3,153
    3,545
    113
    Kandy
    Something like this
    I saved it on Desktop as 88.py
    it opened then asked me to Enter something. But after entering some text it suddenly disappeared without printing the text that I entered

    user_input = input("Enter something: ")
    print("You entered:", user_input)


    send the code

    āļšāˇ āļ¸āˇ’āļ§āˇŠāļ§āˇœ āļšāˇāļŠāˇŠ āļ‘āļš

    āļšāˇāļŠāˇŠ āļ‘āļš āļąāˇāļ­āˇ”⎀ āļ…āļ´āˇ’ āļšāˇœāˇ„āˇœāļ¸āļ¯ āļŠāˇ’āļļāļœāˇŠ āļšāļģāļąāˇŠāļąāˇš
    ------ Post added on May 8, 2023 at 1:59 PM
     

    Mr Bones

    Well-known member
  • Mar 13, 2023
    16,714
    1
    32,936
    113
    Something like this
    I saved it on Desktop as 88.py
    it opened then asked me to Enter something. But after entering some text it suddenly disappeared without printing the text that I entered

    user_input = input("Enter something: ")
    print("You entered:", user_input)





    ------ Post added on May 8, 2023 at 1:59 PM
    bit strange,
    what is the OS ?
     

    C_S_M

    Well-known member
  • May 8, 2023
    3,153
    3,545
    113
    Kandy
    Screenshot (5).png


    bit strange,
    what is the OS ?
    Windows 10
    ------ Post added on May 8, 2023 at 2:29 PM
     

    EKGuest

    Well-known member
  • Nov 16, 2022
    3,206
    5,703
    113
    user_input = input("Enter something: ")
    print("You entered:", user_input)



    āļ¸āļ¸ āļ´āļē⎒āļ­āļąāˇŠ āļšāļģāļŊāˇ āļąāˇ‘ āļ¸āļ§ āˇ„āˇ’āļ­āˇ™āļą āˇ€āˇ’āļ¯āˇ’āļēāļ§ āļ”āļ­āļą āˇ€āˇ™āļąāˇ€āˇ āļ‡āļ­āˇŠāļ­āˇš output āļ‘āļš āļ´āˇŠâ€āļģ⎒āļąāˇŠāļ§āˇŠ āļšāļģāļ´āˇ” āļœāļ¸āļąāˇŠāļ¸ āˇ€āˇ’āļąāˇŠāļŠāˇ āļ‘āļš āļšāˇŠāļŊ⎜⎃⎊ ⎀⎙āļąāˇ€āˇ. āļšāˇāļŠāˇŠ āļ‘āļšāˇš āļ…āļąāˇŠāļ­āˇ’āļ¸āļ§ input() āļ¯āˇāļŊāˇ āļļāļŊāļąāˇŠāļą:

    Python:
    user_input = input("Enter something: ")
    print("You entered:", user_input)
    input()

    https://stackoverflow.com/questions/1000900/how-to-keep-a-python-script-output-window-open
     
    • Like
    • Love
    Reactions: Plusky and C_S_M

    C_S_M

    Well-known member
  • May 8, 2023
    3,153
    3,545
    113
    Kandy
    āļ¸āļ¸ āļ´āļē⎒āļ­āļąāˇŠ āļšāļģāļŊāˇ āļąāˇ‘ āļ¸āļ§ āˇ„āˇ’āļ­āˇ™āļą āˇ€āˇ’āļ¯āˇ’āļēāļ§ āļ”āļ­āļą āˇ€āˇ™āļąāˇ€āˇ āļ‡āļ­āˇŠāļ­āˇš output āļ‘āļš āļ´āˇŠâ€āļģ⎒āļąāˇŠāļ§āˇŠ āļšāļģāļ´āˇ” āļœāļ¸āļąāˇŠāļ¸ āˇ€āˇ’āļąāˇŠāļŠāˇ āļ‘āļš āļšāˇŠāļŊ⎜⎃⎊ ⎀⎙āļąāˇ€āˇ. āļšāˇāļŠāˇŠ āļ‘āļšāˇš āļ…āļąāˇŠāļ­āˇ’āļ¸āļ§ input() āļ¯āˇāļŊāˇ āļļāļŊāļąāˇŠāļą:

    Python:
    user_input = input("Enter something: ")
    print("You entered:", user_input)
    input()

    https://stackoverflow.com/questions/1000900/how-to-keep-a-python-script-output-window-open
    It works. Thank you so much
     
    • Like
    Reactions: Plusky