Python Forum

Full Version: Python 3.13 : def setup size
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear Forum member,

How do I define "define setup : size"?

"
def setup ():
...
size(600,600)

" : Attachment : Size

Result : Attachment : NameError : Size not defined.

Regards.

HansieB



Regards.

Hans
What is “size(600, 600)” supposed to do? Python sees it as calling a function named size and passing two arguments
Dear member,
I have copied the lines from the book "Math advantures with python(3), Farell (2019).

Setup is a Processings build in function. With the setup() function the size of a display screen is declared. Using size(600,600) a display screen of 600 pixels by 600 pixels is defined.

Regards.

HansieB
(Nov-30-2024, 10:52 AM)buran Wrote: [ -> ]Please, don't post images of code, errors, input/output.
Copy/paste as text, properly formatted using BBCode tags

How do I do that?
Looking at a book preview online it appears that it uses turtle graphics and a package called processing. size(600, 600) appears to be a processing command. You can learn about processing here:

https://processing.org/

An article about using processing

https://www.geeksforgeeks.org/how-to-set...rocessing/
(Dec-02-2024, 09:59 AM)HansieB Wrote: [ -> ]How do I do that?
https://python-forum.io/misc.php?action=help&hid=25