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.


    Python 3.6 and pythonista

    Pythonista
    5
    5
    3115
    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.
    • gumbyman
      gumbyman last edited by

      Is it possible to use pythonista with python 3.6? I’m trying to use it with ‘Learn python 3 the hard way’ but it doesn’t work on the new format commands such as

      print( f" Here's your file {filename}:")

      It also struggles with argv commands saying there are not enough arguments. Has anyone used it successfully with python 3.6 or is there an update somewhere that I’m missing?

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

        Python 3.6 support isn't ready yet, but it's coming soon, i.e. you cannot use Python 3.6 in Pythonista right now.

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

          By the way, the beta version has already included Python 3.6 for a while, and it's working quite well. I haven't noticed any problems specific to 3.6. (There's of course no guarantee that anything from the beta will be in the next release update, but it seems very likely.)

          With "argv commands" do you mean scripts where you would pass extra arguments in the shell like python3 myscript.py arg1 arg2 arg3? To do that in Pythonista, you can long-tap on the play button, which brings up a popup with extra options for running your script. In the text field at the top you can type arguments for your script. (You only need to type the arguments, like arg1 arg2 arg3, not a full python3 command.)

          Also, a small note regarding LPTHW - you should be aware that the author has some strong opinions about Python 3. Until recently the book was Python 2 only and was extremely negative about Python 3. I don't have the full Python 3 edition, so I don't know how much that has changed. Just be aware that the author's opinion isn't that of the Python community in general.

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

            For a potential f-strings workaround, check out https://forum.omz-software.com/topic/4355/scripter-pythonista-ui-animation-framework-built-on-ui-view-update/9

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

              ok @ccc, i tried future_fstrings, and it does work, provided you:

              1. pip install tokenize_rt
              2. download future_fstrings.py, and copy into site packages
              3. in your pythonista_startup, include the following:
              import future_fstrings 
              future_fstrings.register()
              

              pretty neat idea (registering a custom encoding with codecs, which gets called on the file to transform it before it gets executed).

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