Python output window disappears immediately in eclipse after run

Mahfuz

I use eclipse IDE and pydev plugins for python development. In eclipse when I run the following code snippet the program output window appears and disappears immediately. How to solve this when using ecliple (not using by terminal or command prompt)?

import turtle 
wn = turtle.Screen() 
alex = turtle.Turtle() 

alex.forward(50) 
alex.left(90) 
alex.forward(30) 

wn.mainloop()

Padraic Cunningham

That is because you get an error, it has nothing to do with eclipse:

AttributeError: '_Screen' object has no attribute 'mainloop'

If you want a continuous loop use a while loop or a for loop:

import turtle
while True:
    wn = turtle.Screen()
    alex = turtle.Turtle()

    alex.forward(50)
    alex.left(90)
    alex.forward(30)

If you want to just see the keep the screen up use exitonclick()

wn.exitonclick()

the docs

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

ui:table immediately disappears after retrieving data

From Dev

Window is closing immediately after I run program in PyQt 4 (anaconda) [PyCharm 4.5]

From Dev

Content disappears immediately after form submitted and function runs

From Dev

Content disappears immediately after form submitted and function runs

From Dev

Cocoa rotated element disappears after window resize

From Dev

Mob Nav Disappears After Window Resize

From Dev

Cocoa rotated element disappears after window resize

From Dev

Mob Nav Disappears After Window Resize

From Dev

My window content disappears after a few seconds

From Dev

Command line Java run from the terminal on Mac pops up Java window in the Mac dashboard which disappears after the jobs is done

From Dev

Unstaged changes immediately after cloning in Eclipse

From Dev

Eclipse opens and then immediately closes after graphic appears

From Dev

Activate Checkstyle on Eclipse projects immediately after import

From Dev

Display eclipse output in external window

From Dev

Run script as root immediately after login to gui

From Dev

Run a program with GNU screen and immediately detach after

From Dev

Reset output after run

From Dev

Tkinter window closes automatically after Python program has run in PyCharm

From Dev

Tkinter window closes automatically after Python program has run in PyCharm

From Dev

How to run Netbeans in Output Window?

From Dev

emacs sql-mode: how to scroll the the output window after run the sql?

From Dev

Console window closes immediately when I run the program

From Dev

How to fix: conky disappears after click on desktop or other window?

From Dev

How to fix: conky disappears after click on desktop or other window?

From Dev

Python zip object 'disappears' after iterating through?

From Dev

Why is window.requestAnimationFrame not working immediately after page refresh?

From Dev

JQuery UI autocomplete disappears immediately

From Dev

JQuery UI autocomplete disappears immediately

From Dev

UIActivityViewController disappears immediately for some users

Related Related

  1. 1

    ui:table immediately disappears after retrieving data

  2. 2

    Window is closing immediately after I run program in PyQt 4 (anaconda) [PyCharm 4.5]

  3. 3

    Content disappears immediately after form submitted and function runs

  4. 4

    Content disappears immediately after form submitted and function runs

  5. 5

    Cocoa rotated element disappears after window resize

  6. 6

    Mob Nav Disappears After Window Resize

  7. 7

    Cocoa rotated element disappears after window resize

  8. 8

    Mob Nav Disappears After Window Resize

  9. 9

    My window content disappears after a few seconds

  10. 10

    Command line Java run from the terminal on Mac pops up Java window in the Mac dashboard which disappears after the jobs is done

  11. 11

    Unstaged changes immediately after cloning in Eclipse

  12. 12

    Eclipse opens and then immediately closes after graphic appears

  13. 13

    Activate Checkstyle on Eclipse projects immediately after import

  14. 14

    Display eclipse output in external window

  15. 15

    Run script as root immediately after login to gui

  16. 16

    Run a program with GNU screen and immediately detach after

  17. 17

    Reset output after run

  18. 18

    Tkinter window closes automatically after Python program has run in PyCharm

  19. 19

    Tkinter window closes automatically after Python program has run in PyCharm

  20. 20

    How to run Netbeans in Output Window?

  21. 21

    emacs sql-mode: how to scroll the the output window after run the sql?

  22. 22

    Console window closes immediately when I run the program

  23. 23

    How to fix: conky disappears after click on desktop or other window?

  24. 24

    How to fix: conky disappears after click on desktop or other window?

  25. 25

    Python zip object 'disappears' after iterating through?

  26. 26

    Why is window.requestAnimationFrame not working immediately after page refresh?

  27. 27

    JQuery UI autocomplete disappears immediately

  28. 28

    JQuery UI autocomplete disappears immediately

  29. 29

    UIActivityViewController disappears immediately for some users

HotTag

Archive