0

I have a directory folder:
MainFolder : [ folder1 : (file1.py), folder2 : (file2.py) ]
I'm writing a program in file2.py, which needs to import the code from file1.py.
Is there a way to do that? I tried this:from .. import folder1.file1.py Can somebody explain what I am supposed to do here? `

Kedr
  • 11
  • 2

1 Answers1

0

To use from yo have to put the directory and import the file without the .py

from folder import file

Try this.

BraAndre
  • 9
  • 2