How to import Python files in the other directories?

Discussion in 'Python' started by Muddy Coder, Mar 6, 2009.

  1. Muddy Coder

    Muddy Coder Guest

    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
     
    Muddy Coder, Mar 6, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel Finkel
    Replies:
    0
    Views:
    505
    Joel Finkel
    Sep 12, 2003
  2. Jeffry van de Vuurst
    Replies:
    2
    Views:
    547
    Jeffry van de Vuurst
    Jul 30, 2003
  3. Replies:
    0
    Views:
    506
  4. Matthew Margolis

    open files in other directories

    Matthew Margolis, Aug 5, 2004, in forum: Ruby
    Replies:
    2
    Views:
    87
    Robert Klemme
    Aug 5, 2004
  5. Adam Petrie
    Replies:
    8
    Views:
    330
    Adam Petrie
    Oct 11, 2004
Loading...

Share This Page