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
  How does this code create a class? Pedroski55 6 359 Apr-21-2024, 06:15 AM
Last Post: Gribouillis
  class definition and problem with a method HerrAyas 2 253 Apr-01-2024, 03:34 PM
Last Post: HerrAyas
  Printing out incidence values for Class Object SquderDragon 3 291 Apr-01-2024, 07:52 AM
Last Post: SquderDragon
  class and runtime akbarza 4 369 Mar-16-2024, 01:32 PM
Last Post: deanhystad
  Operation result class SirDonkey 6 533 Feb-25-2024, 10:53 AM
Last Post: Gribouillis
  The function of double underscore back and front in a class function name? Pedroski55 9 666 Feb-19-2024, 03:51 PM
Last Post: deanhystad
  super() and order of running method in class inheritance akbarza 7 737 Feb-04-2024, 09:35 AM
Last Post: Gribouillis
  Class test : good way to split methods into several files paul18fr 4 485 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  Good class design - with a Snake game as an example bear 1 1,837 Jan-24-2024, 08:36 AM
Last Post: annakenna
  question about __repr__ in a class akbarza 4 613 Jan-12-2024, 11:22 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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