Python - Modules and Code Organization
How can you programmatically check if a directory is already in Python's module search path before adding it?
in operator to check if the directory string is already in sys.path.sys.path is a list; it has no contains or add methods, and index raises errors if not found.if 'dir' not in sys.path: before inserting. -> Option C15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions