0

Hello so I am currently running Ubuntu on my machine and I am trying to use the python graphics module turtle, the thing is the module works fine in a bash terminal but I can't get the screen to open in VSCode. I know turtle is installed and I know I imported turtle correctly

So any advice would be helpful Thank You

Shay
  • 1
  • 1

1 Answers1

0

The Turtle package is built into python, so there shouldn't be a problem with opening it through the VSCode terminal. Here are a couple of ideas to try and fix the problem.

  1. As seen in another thread, it's possible that the turtle program is opening and instantly closing because your program terminates too quickly to view the GUI window. Here provides a solution by putting: input("Press enter to exit..."); to stop the program from closing instantly.

  2. Are you sure that the program is running correctly in VSCode at all? To verify this you can just insert print statements every so often to check that VSCode is correctly running your program

  3. Try to run the program as a superuser, in case VSCode doesn't have certain privileges (this one is unlikely).

If all else fails, you can try out one of the user's suggestions in this Reddit thread

  • Thing is though, turtle works perfectly in nano, it does what it's supposed to do, but when I paste the exact same code into VS, it'll always spit out an error. I know it's not the program it self but it's probably VS itself – Shay Mar 02 '20 at 04:13