Posts: 8
Threads: 2
Joined: Oct 2019
Hello,
I am trying to make changes in the turtle graphics window size. I tried using the screensize() and the setup() methods, but no success. The latest code was very simple:
from turtle import *
setup(600,500)
for i in range(7):
forward(50)
left(90)
forward(50)
right(90) I have updated my Python version to 3.8 and running under Windows 8.1 pro. I tried everything.... It doesn't work. Thank you for your help.
Posts: 212
Threads: 25
Joined: Aug 2019
(Oct-27-2019, 09:13 PM)bobfat Wrote: I have updated my Python version to 3.8 and running under Windows 8.1 pro. I tried everything.... It doesn't work. Thank you for your help.
Hi!
I ran your program on my Python 3.7.4 Shell and Windows 10, and it runs without any problems.
Did you check if it ran without any problems before updating your Python version to 3.8?
I've read here, on this site, that some people are having some trouble running some modules with Python 3.8. That may be also your case.
All the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Posts: 8
Threads: 2
Joined: Oct 2019
Hi,
In fact, it doesn't give any kind of errors, the code runs OK, but simply not resizing the window.
Posts: 212
Threads: 25
Joined: Aug 2019
(Oct-27-2019, 11:20 PM)bobfat Wrote: In fact, it doesn't give any kind of errors, the code runs OK, but simply not resizing the window.
Then, if you run this modification of your program, you can see if the window size really changes or not:
from turtle import *
setup(600,500)
for i in range(7):
forward(50)
left(90)
forward(50)
right(90)
setup(200,100)
for i in range(7):
forward(50)
left(90)
forward(50)
right(90) All the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Posts: 8
Threads: 2
Joined: Oct 2019
While I am testing, I tried the same code but I replaced the setup() method value: instead of using dimensions in pixels, I used percentage:
from turtle import *
setup(0.75,0.95)
for i in range(7):
forward(50)
left(90)
forward(50)
right(90) I worked just fine. It solves the problem but I can't understand why it doesn't work when I use pixels.
Thank you very much!
Posts: 212
Threads: 25
Joined: Aug 2019
(Oct-28-2019, 12:03 AM)bobfat Wrote: I tried the same code but [ ... ] instead of using dimensions in pixels, I used percentage:
from turtle import *
setup(0.75,0.95) [ ... ] I can't understand why it doesn't work when I use pixels.
My understanding is that you are trying to set the dimensions of the window to less than a pixel per side, so I think there is a minimum default size of the turtle window.
All the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Posts: 8
Threads: 2
Joined: Oct 2019
Thank you very much for your help.
Posts: 212
Threads: 25
Joined: Aug 2019
(Oct-28-2019, 10:51 AM)bobfat Wrote: Thank you very much for your help.
You're welcome!
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
|