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.


    Reload for a "from x import y"

    Pythonista
    3
    3
    2136
    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.
    • polymerchm
      polymerchm last edited by

      Is there such s thing

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

        This should work:

        import x
        reload(x)
        from x import y
        del x # if the name gets in the way
        
        1 Reply Last reply Reply Quote 0
        • 0942v8653
          0942v8653 last edited by

          You could also do

          reload(__import__('x'))
          from x import y
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors