Skip to content
Sign upLog in
← Back to Community

How to import a file in python?

Profile icon
AnonymousDark

I checked the other answers and they work somewhat but also give a ton of errors. I and My friend are working on a project in which we decided it would be easier to make files instead of having all our code on main.py. However, this has left us with a ton of bugs. Import [File name] works however it presents an error every time we run it. The code also says that the file is imported but unused which has left us confused.

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
putrifaliha6
Profile icon
AnonymousDark
Comments
hotnewtop
Profile icon
Coder100
Profile icon
AnonymousDark

@Coder100
thanks I'll try and see if it works.

Profile icon
ch1ck3n

can you share the link to the repl please

Profile icon
AnonymousDark

@ch1ck3n
don't know-how. I'm still new to replit