How to import Python files in the other directories?

M

Muddy Coder

Hi Folks,

If I have a python file foo.py in the current directory, I can simply
import it in the way below:

import foo

when a project keeps grow, more and more Python files are created, and
they are also needed to put into different directories. Then, a
problem comes: how to import the Python files residing in the other
directories? Somebody helps me out? Thanks!


Muddy Coder
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top