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.


    Newb to Python and Pythonista

    Pythonista
    4
    4
    1743
    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.
    • Kithara
      Kithara last edited by

      when I create a script named 'mymodule' with class named 'myclass' in the Pythonista editor I can import that module from the console, instantiate the the class and test from the console. However when I make changes in the editor, and repeat that procedure my changes are not reflected in the console. I have tried 'reload' but that fails with an exception saying that module doesn't exist. I assume this due to my Python ignorance.

      Version 1.5 which I have, should be saving and reloading my script file containing the changes. But no go. If I restart Pythonista it then works. What am I doing wrong? The code seems to be correct and we are talking hello world level here.

      Kithara

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

        Try: import mymodule ; reload(mymodule)

        You can also tap and hold on the clear button at the top right of the console window to restart Pythonista.

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

          @Kithara I usually just double tab the home button, close, then reopen Pythonista. Clear seems to take longer. I havent tried @ccc 's trick.

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

            Did you try executing the modified script (by tapping the "play" button) before importing it from the console?

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