how to import a class from a file to another python

35

from application.app.folder.file import func_name
#from your main script

from folder.file import Klasa

#OR

from folder import file
k = file.Klasa()

#OR

import folder.file as myModule
k = myModule.Klasa()

Comments

Submit
0 Comments