Python Forum
Possible to create an object inside another object that is visible outside that objec
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Possible to create an object inside another object that is visible outside that objec
#1
I know it sounds confusing so I'll try to illustrate the question

in Main:

self.myobj = myclass


self.myobj(parameters)
the object code

class myobj(object)

    def __init__(self, ...):

    def mymethod((self, ...):

         my2ndobjinfirstobj  = my2ndclass
Forgiving the mile of inaccuracy above, can main use my2ndobjinfirstobj as if it were created in main? or reference it somehow?
Gribouillis write May-24-2023, 06:06 AM:
Please post all code, output and errors (it it's 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
Possible to create an object inside another object that is visible outside that objec - by MeghansUncle2 - May-24-2023, 01:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Script problem - Illegal access to removed OSM object MarcPolo72 0 92 Jun-23-2024, 04:26 PM
Last Post: MarcPolo72
  The INSERT permission was denied on the object Steven5055 3 1,750 Jun-12-2024, 08:13 AM
Last Post: GregoryConley
  how to capitalize letter in list object Python iwonkawa 4 316 May-29-2024, 04:29 PM
Last Post: DeaD_EyE
  I am getting this TypeError: 'TreasureMap' object is not subscriptable. makilakos 2 342 May-25-2024, 07:58 PM
Last Post: deanhystad
  Printing out incidence values for Class Object SquderDragon 3 503 Apr-01-2024, 07:52 AM
Last Post: SquderDragon
  This result object does not return rows. It has been closed automatically dawid294 6 1,768 Mar-30-2024, 03:08 AM
Last Post: NolaCuriel
  TypeError: cannot pickle ‘_asyncio.Future’ object Abdul_Rafey 1 696 Mar-07-2024, 03:40 PM
Last Post: deanhystad
  How can I pause only one object? actualpy 1 464 Feb-01-2024, 07:43 PM
Last Post: deanhystad
  error in class: TypeError: 'str' object is not callable akbarza 2 715 Dec-30-2023, 04:35 PM
Last Post: deanhystad
Question Chain object that have parent child relation.. SpongeB0B 10 1,505 Dec-12-2023, 01:01 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