Understand Python Path — Import Variable From __init__.py (update)

Photo by AltumCode on Unsplash
colour_map_earth_tone = ['#E8D0A9', '#B7AFA3', '#C1DAD6', '#b7baba', '#ACD1E9', '#6D929B']
if __name__ == '__main__':    from __init__ import colour_map_earth_toneelse:    from . import colour_map_earth_tone

--

--

Visit my blog for more contents like these: https://chienhsiang-hung.github.io/blog/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store