EITHER IM JUST STUPID OR PYTHON IS MESSING WITH ME

posted in Off Topic
View:
Threaded
Linear
Threaded
#1
Foxym
0
Frags
+

https://i.ibb.co/hx9TJ455/image-1768299931917.png
FUCK YOU MEAN THE CLASS ISNT DEFINED?!
(changing the class name does nothing)

edit:
I was just stupid

#2
zekken_is_a_baller
0
Frags
+

def init (self): with 2 underscores BOTH SIDES but vlr is fucked
self.screen = t.Screen()

you have to use self for every function inside a class as the first argument

#3
Foxym
0
Frags
+

im using that function to make turtle function how i want it to
renaming it does nothing and i dont think making that will do anything as i dont know what to put inside it

#5
zekken_is_a_baller
0
Frags
+

it works for me dawg idk what youre doing

#4
Foxym
0
Frags
+

tried it,
still results in the same error

#7
zekken_is_a_baller
0
Frags
+

underscoreunderscoreINITunderscoreunderscore(self):
self.screen = t.Screen()

#6
TentacleThing
0
Frags
+

I mean from my somewhat limited experience this is how I would write it and we can't really see the full code which makes it a bit harder to diagnose but you could always just ask chatgpt if this doesn't work:

import turtle as t

class Game:
    def __init__(self): #There are two underscores on each side of init
        self.screen = t.Screen()
        self.screen.tracer(0)
#8
Castawaytwizz
0
Frags
+

just ask claude

#9
Foxym
0
Frags
+

I figured out the issue, The turtle function i was using doesnt allow to call other Non-Turtle functions

#10
zekken_is_a_baller
0
Frags
+

you were using the init method wrong anyways

  • Preview
  • Edit
› check that that your post follows the forum rules and guidelines or get formatting help
Sign up or log in to post a comment