Python Forum
What to modify in the program such that ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What to modify in the program such that ...
#9
Quote:@jefsummers - what is the purpose of g.go property? and the class - as it is it defy the purpose of class.
From the OP
Quote:but it must not not display anything if it is imported as a module.
So the go property is a flag, so that it does not display anything unless go is set to True. Someone importing as a module and accessing the functions directly will not get anything displayed. Running the file by itself will run properly.
@buran - in both of your solutions the functions can be called and will output even if the file is imported as a module.
Or maybe I misunderstood the question.
Reply


Messages In This Thread
RE: What to modify in the program such that ... - by jefsummers - Mar-01-2020, 07:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I am writing a car rental program on python. In this function I am trying to modify aboo 2 2,947 Aug-05-2021, 06:00 PM
Last Post: deanhystad
  Modify code from running program ? samuelbachorik 2 2,577 Jun-26-2020, 08:17 PM
Last Post: samuelbachorik

Forum Jump:

User Panel Messages

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