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 ...
#10
yep, you misunderstood the question. In the OP original code if they import it in another module, then the 2 functions are accessible, but also lines 9-11 get executed at the time of the import. OP wants to prevent this from happening
(Feb-29-2020, 06:15 AM)sbabu Wrote: only displays the information when executed directly, but it must not not display anything if it is imported as a module
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: What to modify in the program such that ... - by buran - Mar-01-2020, 07:57 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