I can't start the turtle

when the program starts, it outputs various errors from other files.

from turtle import*


File "c:\users\zarte\desktop\untitled-1.py", line 2, in <module>
  import turtle
File "d:\vsyakoe\python\lib\turtle.py", line 107, in <module>
  import tkinter as TK
File "d:\vsyakoe\python\lib\tkinter\__init__.py", line 53, in <module>
  _magic_re = re.compile(r'([\\{}])')
File "d:\vsyakoe\python\lib\re\__init__.py", line 227, in compile
  return _compile(pattern, flags)
File "d:\vsyakoe\python\lib\re\__init__.py", line 294, in _compile
  p = _compiler.compile(pattern, flags)
File "d:\vsyakoe\python\lib\re\_compiler.py", line 743, in compile
  p = _parser.parse(p, flags)
File "d:\vsyakoe\python\lib\re\_parser.py", line 980, in parse
  p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "d:\vsyakoe\python\lib\re\_parser.py", line 455, in _parse_sub
  itemsappend(_parse(source, state, verbose, nested + 1,
File "d:\vsyakoe\python\lib\re\_parser.py", line 864, in _parse
  if not source.match(")"):
File "d:\vsyakoe\python\lib\re\_parser.py", line 249, in match
File "d:\vsyakoe\python\lib\re\_parser.py", line 234, in __next
  char = self.decoded_string[index]

builtins.IndexError: string index out of range

or other else.

foxr's avatar
asked 2023-03-14 02:32:20 -0500
Wingware Support's avatar
Wingware Support
updated 2024-03-05 09:23:53 -0500
edit flag offensive 0 remove flag close merge delete


This may be a problem with your Python installation and you might try re-installing. Does it work outside of Wing?

Wingware Support's avatar Wingware Support (2023-03-14 09:40:43 -0500) edit

I've already tried reinstalling both python and wing. if you run the same file through idle, it works without errors.

foxr's avatar foxr (2023-03-14 13:52:52 -0500) edit

Does it work from the command line? What Python version are you using? Do you have any PYTHON* environment variables set? Sorry for all the questions, but this is an odd exception.

Wingware Support's avatar Wingware Support (2023-03-14 14:03:14 -0500) edit

I am using 3.11 Python, I don't have any versions of Python, it's also works from the command line.

foxr's avatar foxr (2023-03-16 12:37:43 -0500) edit

Do you have exception reporting set to Always Immediately on the Debugger page of Preferences? When this option is set, Wing stops on every exception raised, even if it's handled by other code. Your example stops for me when this option is selected like it should. You probably want to use one of the other exception reporting options.

Wingware Support's avatar Wingware Support (2023-03-17 15:45:27 -0500) edit
add a comment see more comments