Python Forum
How to pass variables from one class to another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass variables from one class to another
#1
How to pass values from one class to another when the class you want to get value from is after. What I mean: Suppose I have two classes:

class One:
    .....
    f = ClassTwoValue

class Two:
    ....
    ClassTwoValue = 2
I want the class One to get the value from class Two. I found solutions (from google search, such as this: https://stackoverflow.com/questions/1999...to-another) only for class Two to get the value from class One... which does not work for my situation... Any ideas?
Reply


Messages In This Thread
How to pass variables from one class to another - by hobbyist - Sep-22-2021, 11:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unchangeable variables in a class? Calab 12 1,789 Sep-15-2023, 07:15 PM
Last Post: deanhystad
  How to pass encrypted pass to pyodbc script tester_V 0 954 Jul-27-2023, 12:40 AM
Last Post: tester_V
  Class variables and Multiprocessing(or concurrent.futures.ProcessPoolExecutor) Tomli 5 4,053 Nov-12-2021, 09:55 PM
Last Post: snippsat
  Acess variables from class samuelbachorik 3 1,962 Aug-20-2021, 02:55 PM
Last Post: deanhystad
Exclamation win32com: How to pass a reference object into a COM server class Alfalfa 3 5,046 Jul-26-2021, 06:25 PM
Last Post: Alfalfa
  Do I have to pass 85 variables to function? Milfredo 10 4,474 Sep-26-2020, 10:13 PM
Last Post: Milfredo
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,637 Sep-07-2020, 08:02 AM
Last Post: perfringo
  Class variables menator01 2 2,086 Jun-04-2020, 04:23 PM
Last Post: Yoriz
  Question about naming variables in class methods sShadowSerpent 1 2,070 Mar-25-2020, 04:51 PM
Last Post: ndc85430
  Pass by reference vs Pass by value leodavinci1990 1 2,277 Nov-20-2019, 02:05 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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