(Mar-27-2017, 08:48 AM)zivoni Wrote: Use exec with only globals.
But from my understanding you only want to import "hidden" file (starting with dot). Two ways were suggested - either use exec or hide your file to a hidden directory and use import. It seems that you insist on doing both at the same time ...
Why you just dont skip your pyconf and wont use something like:
import sys sys.path.append('.config/boo') import my_config_in_boo
since it was suggested to me, because i had not come up with the idea on my own, i looked closely at exec(), and it gave me the idea that having all the incoming config data placed in a separate dictionary, would add beneficial safety, avoiding a chance of variable name collision. that and it allows for the case of the base file name having the dot regardless of which directory it is in.
i have switched to using just 2 args on exec().
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.