class a:
def aa(self):
self.aaa = 1
class b:
def bb(self):
a.aa()
bbb = b()
bbb.bb()
In the b
class, self.I wonder how to use the aaa
value.
I think it's because you've oversimplified the code, but I'm not sure what kind of role the class b
should play with just the code you wrote.
Your question depends on whether class b
inherits a
, a
as an instance variable, or a
as a parameter.
Accordingly, in class b
, what bb
does is self.It can be set to aaa=1
, it can be set to self.a.aa=1
, or it can also be used to run aa
of the class a
received as a parameter.
If you think carefully about the direction you want, I think the direction of implementation will be concrete.
581 GDB gets version error when attempting to debug with the Presense SDK (IDE)
558 Who developed the "avformat-59.dll" that comes with FFmpeg?
821 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
560 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.