#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9

    Unhappy Help, extra newb question


    i have done some really simple stoff with python
    and i will right a program but for some reason when i run it, it doesnt run, it like flashes and it is gone...

    so i thought it would do that if i didnt put anything in for the user to do. like press a button to exit or do anything, but of course i have something for the user to do.

    i dont know why it keeps doing this, do i make any sense?

    plz help!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9
    plzzzz
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    51
    Hi!

    We can't really help you if you don't show your code
    You said "it flashes" so I guess it's some kind of GUI stuff. Tkinter?
    Maybe you forgot root.mainloop()?

    Regards, mawe
  6. #4
  7. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Maybe he isn't using a GUI at all, instead he's using the console. If this is so then he has an error occuring at startup of the program and it instantly closes. Do this to find out what the error is:

    At the top of all of your code, type this:
    Code:
    import time
    try:
    Then indent all of your programs code by one time (Tab key once) that is below this.

    Then add at the very bottom, but don't indent this, keep it as far as left as it can go, so it is lined up with the try::

    Code:
    except Exception, inst:
    print inst
    time.sleep(1000)
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    588
    Rep Power
    64

    Smile


    At the endof your program add:
    Code:
    # console wait for keypress
    raw_input('Press Enter')
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    If it is flashing up a command line box, then it is probably throwing an exception. Run it from the command line instead of double-clicking on the icon and you will be able to see what the exception is and fix it.

    Dave - The Developers' Coach
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    run it from IDLE to see the exception and anyways it only can be a error if it flashes
    Those people who think they know everything are a great annoyance to those of us who do.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9
    Originally Posted by Dietrich
    At the endof your program add:
    Code:
    # console wait for keypress
    raw_input('Press Enter')
    ye thatis what i got at the end of it.

    sorry i forgot the code, and thanks for the suggestions, ill try
    if what you guys said doesnt fix it ill show the code
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9
    THANKS YOU, it worked
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9
    thanks, i got it to work
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9
    oopse i said it twice, lol
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    33
    Rep Power
    9
    ok i got another question:

    what does, cant assign to operator mean?
  24. #13
  25. Commie Mutant Traitor
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2004
    Location
    Norcross, GA (again)
    Posts
    1,804
    Rep Power
    1569
    Can you show us the section of code the error is occuring with? It's very hard to speak of these things in general terms.

    Oh, and if you haven't already, you would do well to read the New Posters thread, including the articles that the lower messages link to. They have some excellent advice on how to get the most out of the fora.
    Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF
    #define KINSEY (rand() % 7) λ Scheme is the Red Pill
    Scheme in Short Understanding the C/C++ Preprocessor
    Taming Python A Highly Opinionated Review of Programming Languages for the Novice, v1.1

    FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov

IMN logo majestic logo threadwatch logo seochat tools logo