Python Forum
modifying what a module defines
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
modifying what a module defines
#1
i have a module that defines some classes and functions. i want to also include some debug tools in it as well. my goal is to get everything in one file. but i don't want the debug tools to be defined every time the module is imported. i'd like to have a way that the code that is importing this module can indicate if it wants the debug tools, too. is there any way to do this within Python3? i'm looking for alternatives to setting (in the code doing the import) and getting (in the module) an environment variable. any suggestions?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
modifying what a module defines - by Skaperen - Aug-22-2019, 10:02 PM
RE: modifying what a module defines - by fishhook - Aug-23-2019, 06:39 AM
RE: modifying what a module defines - by Skaperen - Aug-24-2019, 07:26 PM
RE: modifying what a module defines - by fishhook - Aug-26-2019, 06:29 AM
RE: modifying what a module defines - by Skaperen - Aug-26-2019, 07:34 PM
RE: modifying what a module defines - by Skaperen - Aug-28-2019, 07:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Modifying code cheburashka 1 1,327 Dec-13-2021, 01:01 PM
Last Post: Kebap
  Modifying Lists RedSkeleton007 12 6,872 Nov-22-2017, 04:31 AM
Last Post: heiner55
  input defines variable but it's not defined tozqo 5 7,307 Jun-05-2017, 02:45 AM
Last Post: tozqo

Forum Jump:

User Panel Messages

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