Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access instance of a class
#2
resolved, it was typo ...
Should be ...
from class_instances_test_v0 import MyClass

Actually it's a little bit more complicated.
Due to hierarchy of files/classes I get such error (AAA and BBB names are alternate names - for ease of understanding):
Error:
ImportError: cannot import name 'AAA' from partially initialized module 'AAA.AAA' (most likely due to a circular import) ({path-to-AAA_class}/AAA/AAA.py)
In file BBB.py I use such import instruction:
form AAA.AAA import AAA
Yoriz write Nov-18-2021, 05:34 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Access instance of a class - by Pavel_47 - Nov-18-2021, 03:28 PM
RE: Access instance of a class - by Pavel_47 - Nov-18-2021, 03:40 PM
RE: Access instance of a class - by Gribouillis - Nov-18-2021, 04:49 PM
RE: Access instance of a class - by Pavel_47 - Nov-18-2021, 04:56 PM
RE: Access instance of a class - by Pavel_47 - Nov-19-2021, 09:38 AM
RE: Access instance of a class - by Gribouillis - Nov-19-2021, 10:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I access objects or widgets from one class in another class? Konstantin23 3 1,154 Aug-05-2023, 08:13 PM
Last Post: Konstantin23
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,389 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  dict class override: how access parent values? Andrey 1 1,723 Mar-06-2022, 10:49 PM
Last Post: deanhystad
  access share attributed among several class methods drSlump 0 1,119 Nov-18-2021, 03:02 PM
Last Post: drSlump
  Class Instance angus1964 4 2,553 Jun-22-2021, 08:50 AM
Last Post: angus1964
  Can we access instance variable of parent class in child class using inheritance akdube 3 14,110 Nov-13-2020, 03:43 AM
Last Post: SalsaBeanDip
  Trying to access next element using Generator(yield) in a Class omm 2 2,076 Oct-19-2020, 03:36 PM
Last Post: omm
  Issue referencing new instance from other class nanok66 3 2,312 Jul-31-2020, 02:07 AM
Last Post: nanok66
  Class variable / instance variable ifigazsi 9 4,508 Jul-28-2020, 11:40 AM
Last Post: buran
  How to access class variable? instances vs class drSlump 5 3,473 Dec-11-2019, 06:26 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020