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.


    A Working Directory in Xcode

    Pythonista
    1
    2
    1424
    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.
    • AlanE
      AlanE last edited by

      Firstly. Pythonista: what a fantastic app!

      And now the new Xcode template for version 3 is superb too... but I am struggling to write persistent text files from my Pythonista3 code when in Xcode simulator or when I test it after building it onto an attached (iPad) device.

      In PY3 the code works as I would expect - writing .txt files to the same location as the code, which persist for reading back in after PY3 is closed and reopened. But from Xcode the files read OK but apparently do not write/update (no error is reported). When the Xcode test app on the iPad is reopened the text file does not reflect the earlier .write() changes either

      I am wondering if it is to do with having no working directory option in Xcode:Edit Scheme:Options which I see in other Xcode examples

      Any help much appreciated.

      Alan

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

        I solved it. Create a folder in the same location as the script. Write the files into that. Works in Pythonista and more importantly in apps (USB installed) as a test from Xcode.

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