python – Importing class from another file

python – Importing class from another file

Your problem is basically that you never specified the right path to the file.

Try instead, from your main script:

from folder.file import Klasa

Or, with from folder import file:

from folder import file
k = file.Klasa()

Or again:

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

python – Importing class from another file

Leave a Reply

Your email address will not be published. Required fields are marked *