Python Forum
Call a varaible from class in the parent class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call a varaible from class in the parent class
#1
Hi experts.
I'm making a modular interface containing tabs with different tools.
These tools are for now :
  • A qr code display for my math teacher.
  • A real-time schedule display of my city's public transport company (the "CTCUB", aka "Bibus")
  • And a calculator.
And the upcoming tools are :
  • A text editor
  • A graphical editor and calculator for math
  • An easy formula editor and calculator for math and physics
  • A print manager for my two beautiful dot matrix printers.
  • Some other tools that I'll need in the future.

The principle, is that I have a main file, in which I import all my tools like an add-on. Then, by running a class, it automatically creates a tab and adds all the widgets in it.
And I'm having trouble making a calculator because I end up creating a class for each button (which seems to be the best way to do it). The problem, is that I end up having a class, into a class Doh . But I don't know how to access a class variable from a child class.

Here is the zip containing all the files so you can see.
http://clement2000.rf.gd/doc/tmp/utilitaireTravail.zip
I added a little comment (line 12, in the init of the calculator folder) to show exactly where I'm having trouble.
Sorry, the GUI is in french, but for international purposes, all the comments ans code is in English. If translation needed, please ask.

I hope you did understand what I want, it's really complex. Big Grin

Thanks in advance for your help,
Clément.
Reply


Messages In This Thread
Call a varaible from class in the parent class - by Clement_2000 - May-09-2019, 09:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python class members based on a type value voidtrance 6 807 Apr-07-2025, 06:56 PM
Last Post: buran
  Create a new subclass in a Python extension based on an existing class voidtrance 6 1,255 Mar-25-2025, 06:37 PM
Last Post: voidtrance
Question [SOLVED] [newbie] Why call super()? When to use parent? Winfried 4 1,011 Feb-10-2025, 11:40 AM
Last Post: Winfried
  printing/out put issue with class arabuamir 3 901 Aug-25-2024, 09:29 AM
Last Post: arabuamir
  Class test : good way to split methods into several files paul18fr 5 3,526 Jul-17-2024, 11:12 AM
Last Post: felixandrea
  [split] Class and methods ebn852_pan 15 3,159 May-23-2024, 11:57 PM
Last Post: ebn852_pan
  [SOLVED] [listbox] Feed it with dict passed to class? Winfried 3 1,257 May-13-2024, 05:57 AM
Last Post: Larz60+
  Class and methods Saida2024 2 1,053 May-13-2024, 04:04 AM
Last Post: deanhystad
  How does this code create a class? Pedroski55 6 1,955 Apr-21-2024, 06:15 AM
Last Post: Gribouillis
  class definition and problem with a method HerrAyas 2 1,390 Apr-01-2024, 03:34 PM
Last Post: HerrAyas

Forum Jump:

User Panel Messages

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