0

Modules in Python

I wanted to draw a turtle on my laptop, wrote everything to make it move, for example, forward and launched it. As a result, in the terminal (Visual Studio Code) it is written that some module is being redefined. Can you tell me what the problem is?

1st Aug 2024, 9:20 AM
Wolf Cub
Wolf Cub - avatar
7 Answers
+ 6
And where is this code you talk about? can you provide a link to it? Needless to say, without any code review it will all be like shooting blanks. Just add a link to it, at least a portion of it which triggered that error...
1st Aug 2024, 10:09 AM
Ipang
+ 3
как называется твой код?
3rd Aug 2024, 12:50 PM
PASHA from Russia 🇷🇺
PASHA  from Russia  🇷🇺 - avatar
+ 2
I don't have the code. It’s just that if I write import tertle, I get an error. Why should I just write to you import turtle? There's a mistake here. He writes that this module is being redefined. That's the problem Ipang
2nd Aug 2024, 6:50 PM
Wolf Cub
Wolf Cub - avatar
+ 1
@Wolf Cub In original post you wrote "I wanted to draw a turtle on my laptop, wrote everything to make it move, for example, forward and launched it." That's why I asked you to add your code link earlier. You wrote (in original post) that you had written everything to make it move. Thus I presumed you already have the code. If `import turtle` was the only line in the code; and it triggers error, perhaps you should reinstall turtle module? https://marketplace.visualstudio.com/items?itemName=oxfordturtle.turtle-vscode Don't save your code using a module name i.e. turtle.py. Use another name.
3rd Aug 2024, 3:38 PM
Ipang
+ 1
PASHA 🇷🇺 , у меня его нет в Sololearn. Код: 1 import turtle 2 3 t=turtle.Turtle() 4 t.fd(100) Проблема: 3 строка: Переопределяется модуль "turtle"
3rd Aug 2024, 5:35 PM
Wolf Cub
Wolf Cub - avatar
+ 1
Ipang Okay, i will try it tomorrow.
3rd Aug 2024, 5:43 PM
Wolf Cub
Wolf Cub - avatar
0
PASHA 🇷🇺 сорян что отвлекаю, но практически никто мою проблему не понимает. У меня такая проблема, что в VSC я импортирую черепашку, в итоге в окне проблем пишет, что черепашка переопределяется. Может ты и не VSC используешь.
3rd Aug 2024, 12:11 PM
Wolf Cub
Wolf Cub - avatar