omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    import path in subdirectories from interactive propmt

    Pythonista
    2
    3
    2250
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jose3f23
      jose3f23 last edited by

      I am trying import a module in a subdirectory using the interactive prompt. Module is not found because it seems Pythonista does not set correctly the path to the current subdirectory.

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        The interactive prompt interpreter is entirely independent from the script editor, so the current directory will always be the documents root, unless you change it with <code>os.chdir()</code>.

        1 Reply Last reply Reply Quote 0
        • jose3f23
          jose3f23 last edited by

          I use:
          sys.path.append('.') and it works.

          Thanks

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors