How to import another class into python? I just started learning python and I don't understand importing. there are two files in one folder. How to import?
2 Answers
Its really easy.
If you want to import a class from another file just write at the start of the file.
from name of the file import name of the class
Remember to put the two files in the folder. :3
1 Comment
TKDzsola
just the file name or extension? I have 2 file. First.py, and Second.py 2 file in 1 folder. i would like to import second.py in first.py... i can use import Sedond.py in the First.py file, but doesn't work... :(