I'm making a program that detects python files and reads their classes and functions for then to be called. How do I list the functions from another python file without importing it? and how do I call them?
Structure of the program:
- Index.py (main py file)
- /Content
- /Modules
- Modules.py
- ChickenModule.py (module I want to get functions from)
- /Modules
Modules.py list all the python files from /Modules and stores them on a list. Index.py calls the functions in Modules.py (Just to keep things less messy)
ChickenModule.py has a Class named ChickenStuff that prints "I'm a chicken" whenever it's self.(something) called.
The goal of the program is for the user to be able to put .py files in modules and when running index.py the functions and classes of said .py files will be listed.
importing them? That would be the standard approach.importis the facility Python has defined for obtaining services and attributes from another module. Why do you need to find another way to accomplish this?importis how the program automatically reads them.importthem somehow to use what's defined in them.