Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem calling main class #580

Open
gaBrisingr06 opened this issue Nov 15, 2024 · 4 comments
Open

Problem calling main class #580

gaBrisingr06 opened this issue Nov 15, 2024 · 4 comments

Comments

@gaBrisingr06
Copy link

I created my class App and into it I created a variable "map" and then for a function I wanted to call "map". However it doesn't recognized "map" saying that "App has no attribute "map" ". So I was wondering if there's an alternative or a way to do it I don't know.

Thank you in advance

@merwok
Copy link
Contributor

merwok commented Nov 15, 2024

Can you show your code?

@gaBrisingr06
Copy link
Author

20241115_175753
20241115_175722

"Celeste" is the name of the App class and yes self.map is in this class

@merwok
Copy link
Contributor

merwok commented Nov 15, 2024

Instances have attributes defined in __init__, but the class itself does not

@gaBrisingr06
Copy link
Author

Yes so I tried to create an instance like that instead of just calling the class :

celeste = Celeste()
celeste

But it didn't worked when I called celest
So I just made map global, it took me less time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants