[Python] importlib ์‚ฌ์šฉ์ž ์ •์˜ ๋ฆฌ๋กœ๋“œ
ยท
๐Ÿ Python
Sol 1) importlib์˜ reload( ) ํ•จ์ˆ˜ ์‚ฌ์šฉ (3.12 ์ดํ›„ imp ์ง€์› X) import example import importlib # make changes to example.py file importlib.reload(example) ๊ธฐ์กด์˜ sys.path.module์— ๋“ฑ๋ก๋œ module์„ reload ์‹œํ‚จ๋‹ค. ์ฃผ์˜ ํ•ด์•ผํ•  ๊ฒƒ์€ ์ ˆ๋Œ€ ๊ฒฝ๋กœ์— ์—†๋Š” module์ผ ๊ฒฝ์šฐ ์ ˆ๋Œ€ ๊ฒฝ๋กœ์— ๋“ฑ๋ก์„ ์‹œ์ผœ์ค˜์•ผํ•œ๋‹ค. Sol 2) JupyterNote Book์—์„œ Magic Command๋กœ reload ํ•˜๋Š” ๋ฐฉ๋ฒ• ๋”๋ณด๊ธฐ https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html autoreload — IPython 8.14..
๋‹คํ–ˆ๋‹ค
'module reload' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก