Ask coding questions

← Back to all posts
How to import a file in python?
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
AnonymousDark
Comments
hotnewtop
Coder100
AnonymousDark

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

ch1ck3n

can you share the link to the repl please

AnonymousDark

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