with __init__.py in the directory, I was able to import it by
from subdirectory.file import *
But I wish to import every file in that subdirectory; so I tried
from subdirectory.* import *
which did not work. Any suggestions?
with __init__.py in the directory, I was able to import it by
from subdirectory.file import *
But I wish to import every file in that subdirectory; so I tried
from subdirectory.* import *
which did not work. Any suggestions?
Found this method after trying some different solutions (if you have a folder named 'folder' in adjacent dir):
for entry in os.scandir('folder'):
if entry.is_file():
string = f'from folder import {entry.name}'[:-3]
exec (string)