Python Forum
Help | Classes to use in real world
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help | Classes to use in real world
#10
Honestly, the autogui thing is fine as is, without classes. Classes/objects are most useful when you have some sort of data or information that's tied to functionality.

In the real world, your wallet would be a class. It keeps track of what's in it (how much money, cards, etc), and it knows what to do with those things (give money, charge card, etc).

In a video game, a class could be your character. You have stats that are different per-character (strength, agility, etc) as well as carried items or equipment, and the character itself knows how to move or attack.
Reply


Messages In This Thread
RE: Help | Classes to use in real world - by nilamo - Jul-08-2019, 07:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hello World! rufenghk 0 933 Jun-02-2022, 09:48 PM
Last Post: rufenghk
  Very new to Python world daveseaman 0 1,452 Jun-25-2021, 07:17 PM
Last Post: daveseaman
  running python hello world Avarage_Joe 8 5,203 Apr-13-2018, 04:20 PM
Last Post: Avarage_Joe
  Hello world! program, window disappears nerio 3 5,566 Mar-16-2018, 07:03 PM
Last Post: knackwurstbagel
  Using classes? Can I just use classes to structure code? muteboy 5 4,978 Nov-01-2017, 04:20 PM
Last Post: metulburr
  'Hello, World!' Problem - Urgent OmarSinno 7 4,468 Sep-07-2017, 06:22 AM
Last Post: OmarSinno
  how to generate random 3d world (like minecraft) in python hsunteik 3 88,776 Jan-06-2017, 06:35 PM
Last Post: metulburr
  Hello World issues when using %% with ipython landlord1984 5 8,775 Dec-11-2016, 10:11 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

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