Python Forum
informatio from importer to importee
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
informatio from importer to importee
#3
if i do it with a setup function, how will the importee/module define things in the importer's global space?

currently with the importer not needing to change anything, the import is done like this:
from debugtoys import pf,pr,pv,sl
and if it needs to force the debugging to be enabled it does:
os.environ['debugtoys']='True'
from debugtoys import pf,pr,pv,sl
i'm guessing what i will need to do is:
import debugtoys
pf,pr,pv,sl = debugtoys.set_up(eval(os.environ['enable_debug']))
is that the kind thing you are suggesting? i want to keep the default case especially simple.
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
informatio from importer to importee - by Skaperen - Nov-18-2018, 07:31 PM
RE: informatio from importer to importee - by Skaperen - Nov-19-2018, 12:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Custom importer and errors Fips 6 595 Apr-14-2024, 02:34 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

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