Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

Import from folders

RYANTADIPARTHI
RYANTADIPARTHI

I have a folder, and in the folder I have on file, and in the file I have one function.

In main.py, I want to import the function from that file, and from that folder.

I tried all methods of importing, but everything gives an error. Can anyone tell me how to do this correctly, or is it a replit error?

Thanks!

1 year ago
You are viewing a single comment. View All
1
1
RYANTADIPARTHI
RYANTADIPARTHI

@bendev9
i already did that. That's the first thing I did. It didn't work, which is why I'm asking in this question.

1 year ago
1
bendev9
bendev9

@RYANTADIPARTHI
, here's another one to try:

import sys sys.path.apped("FULL_PATH_TO_FOLDER") from file import function function()
1 year ago
1
RYANTADIPARTHI
RYANTADIPARTHI

@bendev9
thanks, but i already figured it out.

1 year ago