I need to import a single class (not the whole file) from a python file starting with number. There was a topic on importing a whole module and it works, but can't find my way around this one. (In python, how to import filename starts with a number)
Normally it would be:
from uni_class import Student
though the file is called 123_uni_class
.
Tried different variations of
importlib.import_module("123_uni_class")
and
uni_class=__import__("123_uni_class")
Error:
from 123_uni_class import Student
^
SyntaxError: invalid decimal literal