omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. omz

    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.


    • Profile
    • Following 0
    • Followers 84
    • Topics 40
    • Posts 2238
    • Best 444
    • Controversial 0
    • Groups 1

    omz

    @omz

    admin

    I make Pythonista and Editorial – @olemoritz on Twitter.

    776
    Reputation
    32701
    Profile views
    2238
    Posts
    84
    Followers
    0
    Following
    Joined Last Online
    Website omz-software.com Location Berlin

    omz Unfollow Follow
    admin

    Best posts made by omz

    • Python 3.x Progress Update

      Python 3.x support has been a topic of discussion here for years, and I finally have some news on that front. :)

      As I've teased a bit earlier on Twitter, I'm working on a version of Pythonista that is based on Python 3.5.1 instead of the current 2.7.5. I've made pretty good progress recently, and the app is already in a completely usable state with most custom and third-party modules working. The app's UI is essentially identical to Pythonista 2.0.

      Things that are working so far:

      • Python 3.5.1 with all new syntax features and most standard library modules (exceptions are basically the same as in 2.x, i.e. mostly Tkinter)
      • Numpy, matplotlib, Pillow, PyCrypto, and most other third-party modules that are currently included in Pythonista 2.0 (in some cases more recent versions than in 2.0)
      • Most custom modules (ui, scene, contacts, reminders, ...)

      Not working yet:

      • A few custom modules (currently only notification, editor, and canvas)
      • The app extension (invoking Pythonista from the share sheet)
      • The URL scheme
      • The documentation browser
      • The example scripts aren't completely ported yet
      • A couple of third-party modules that are included in Pythonista 2.0, but aren't (yet?) compatible with Python 3 (screenplain, midiutil, mechanize, xhtml2pdf)

      There are probably still a few bugs in the ported versions of my custom modules. Getting the string/unicode handling to work right has been tricky in some cases, and I haven't tested all modules very thoroughly yet.

      I expect that I'll have the first beta ready within the next week or so, hopefully without some of the limitations I've listed above. I'll post a new beta signup form here when I'm ready.

      Lastly, this will be a separate app, or "paid upgrade" if you will. This is, by the way, one of the reasons I did not charge for the 2.0 update. It'll co-exist with Pythonista 2.x for a while because there are still valid reasons to prefer Python 2.7, and I don't want to force people to upgrade to a version that is not backwards-compatible.

      As I've mentioned before, creating an app that supports both Python 2 and 3 would be very difficult, if not impossible. The only way this could theoretically work would require relaunching the app in order to switch versions, and I honestly think that having Python 3 in a separate app will result in a better user experience and less confusion. It will be possible to access files in Pythonista 2.x from 3.x though (and vice-versa).

      posted in Pythonista
      omz
      omz
    • Pythonista Slack Chat

      I'll put this here as a sticky post, so that it's easier to find, without digging through old threads...

      We now have a Slack chat for discussing all things Pythonista, and everyone who's interested can sign up here:

      → Join Pythonista Slack

      This is not intended to be a replacement for the forum. In a lot of cases, it is much more useful to post questions and feedback here because the forum content is indexed by search enginees, available publicly (without signing up for anything), and generally more long-lived. A lot of questions come up more than once, and it's useful to be able to link to forum topics later.

      Note: This topic is locked, but if you have any trouble with the Slack signup, please feel free to create a new thread.

      posted in Pythonista
      omz
      omz
    • Pythonista 2 Release

      Good news: Pythonista 2 has been approved by Apple, and will be out on Monday (tomorrow).

      I would recommend that all beta users do a backup before updating because I'm not completely sure if a clean update will be possible from the beta. Actually, you might also want to do this if you are not using the beta, just to be sure. There's always a possibility that something goes wrong with a major update like this.

      2.0 will be a free update for existing users, but I intend to increase the price for new purchases to $9.99 (version 1.5 is currently $6.99).

      posted in Pythonista
      omz
      omz
    • RE: Python 3.x Progress Update

      @ccc @OI

      The final version of Python 3.6 is still quite a long way off, so I'm not too concerned about that...

      The current beta is taking a bit longer because I'm in the process of making some pretty substantial changes. In short, I've found out that my assumptions about using Python 2 + 3 in the same app were incorrect, and that it is in fact possible to do this, even without having to restart the app when switching interpreters.

      As I really only want to have one version of Pythonista, to avoid confusion and backwards-compatibility woes, my current plan is to make Pythonista 3 support both Python 2.7 and 3.5. It's actually working quite well already, but there are just a lot of little details to consider, things to move around, refactor, etc.

      This doesn't change my plan to make this a paid upgrade btw.

      posted in Pythonista
      omz
      omz
    • Helper script for embedding pyui files in single-file scripts

      I've just built a little script to make it easier to share UI scripts. Sometimes, it's just more convenient to have everything in a single file for simple copy/paste – this basically generates code to load the UI from an embedded (compressed) string instead of from an external .pyui file.

      Here's the code:

      EmbedPyui.py (Gist)

      (some more details about how to use it in the docstring)

      And this is an example of what the generated code looks like (this is from the bundled ColorMixer example):

      data = '''\
      QlpoOTFBWSZTWXGZJlkAA4FfgBAAWGd/8D/HGYq/79/6UAOe4DODcAKGkSeRpNPSNlHoTQ
      AMgAAADSBoaKnsEk0AABoAAABElCmxEyah6T9SGgNqeKGjTQGTR6hzAATAAEwAAAAACpJC
      NTAp6NNINqADQAaeo00zUeLNIRevYhXCrDnMydv5ddssuKvtW15+Xbtq5Jb7tdp+9zbxAt
      0YFOEK1PYeGP1TvLaJaWQwRKSmwu10yMYD+I3AZhIpeImxVjxApqNRWMEpqlaWFSEBpDL/
      aufdj7d+bciZInpuffUawrbLDoAvAbnRnsGwjlCwY3AQoiMikcVFxjaN+bHfmJbntv5eF2
      +uFa81a57LMdue7TprLZNiPISIBIJIpCEjJJyQUTLnrPqyRNwBBIRSQ6G5UCEdREAQhnkc
      6VdTklBZifrGeSmnRkpxuY0EVsxA1pVB5Qsz4MiA4S8EXkSFKFsCzBrVMbE5AonjPMqxNC
      wkHGbGhkyVvKNgvhUrMzbhyRIMUtxbanSoYg+DVEpEagCDTofplQ3HJlBms7EigcLOq3RN
      EFnsFtYRbfKW4/Xg+4el7Z5BiEa4QvDTfExOSYnYNrB8bvRTDiUXComARAkIEKYi2uQM0N
      wquuSlujXUQINEaOD0so0QHiOEwuir0S0zm12Bd4dWkF5BtsG9FSbCDFaughLw0+P7WKlQ
      DzAdvV2jJ1bfW8DetJUYFS5Uu4fTq9o4DhGuO1X7cZkkZhiMA2oxWh2ilVcKF0RctN1Xou
      kwaxiLoYw7hbBokOM/0utJ81GN1q71DY/mocm3dN37tJFhz/3wTOL29qnhmhI3MriMuzv2
      ugX87PJph2cWzffrVjBZ02cdE6BvZLDeyOedIocsxTdhkSLRyblpDmvSXjP5aUqNoy4N14
      syUvKLVLTKNLr1xGhgilLNaVL6cqRkhh0DTObOaIqIqSZhaGcahUjYMBllDUyaHJr8EpNg
      7t+MqoZhg357F85kWcrJrJ0yLGcapzSM2mYR5gNDHyATsKOUTCXuuAaYcWnwTbJzAd/ApR
      Ucg6hwdb9dn84ZR9Rl4V+Zav+LuSKcKEg4zJMsgA==
      '''
      import ui
      import bz2
      from base64 import b64decode
      pyui = bz2.decompress(b64decode(data))
      v = ui.load_view_str(pyui.decode('utf-8'))
      

      Should work in Pythonista 2 and 3 (beta).

      posted in Pythonista
      omz
      omz
    • RE: [Feature Request] Pythonista built-in file picker

      I've started working on a file picker dialog that I might add to the dialogs module. You can find the code here:

      → File Picker.py (works in Pythonista 2 and 3)

      The API isn't exactly like you suggested, but similar, and quite extensible. As a demo, I've implemented an alternative "data source" that shows files and folders from an FTP server instead of the local file system. It would easily be possible to build a Zip file browser with this as well...

      The idea is basically that you can subclass TreeNode to represent whatever kind of tree structure you need. The TreeDialogController gets one TreeNode as its root and a couple of options (multiple selection etc.). The TreeNode is then responsible for loading its children (each of the children is also a TreeNode), and each node has a title/icon that is shown in the table view. For cases when a node might take a relatively long time to load its children, TreeDialogController has an async_mode option that causes it to automatically dispatch the loading to a background thread, and to show a spinner overlay while loading.

      Overall, the UI is very close to Pythonista's own directory picker, i.e. I'm using the same icons, table view animations, etc.

      Screenshot

      posted in Pythonista
      omz
      omz
    • Barcode / QR Code Camera Scanner Demo (objc_util)

      Someone asked me on Twitter if Pythonista had support for scanning barcodes, using the camera. While there's nothing like that built-in, I looked around a bit, and it turns out that there are APIs for this in Apple's AVFoundation framework, so I thought it might be interesting to build a wrapper around that.

      This demo shows a live camera preview, and it plays a sound when a barcode or QR code is found in the viewfinder. The scanned code (a number for EAN codes, URLs or text for QR codes...) is shown in an overlay label. When the view is closed, a list of all (unique) codes that were scanned is printed to the console.

      Here's the code: Barcode Scanner.py (Gist)

      And a screenshot:

      posted in Pythonista
      omz
      omz
    • RE: When will OMZ release an Xcode Template for Python3?

      Here's a first attempt at a Python 3-based Xcode template: https://www.dropbox.com/s/5l94m0xjbot5je0/Pythonista3AppTemplate.zip?dl=1

      This is roughly equivalent to the current App Store version (not the 3.3 beta), and not final, just something to play around with for people interested in the Xcode template. Let me know if anything's unclear.

      posted in Pythonista
      omz
      omz
    • RE: Python 3.6

      I'm making progress... There's still a lot left to do, but it's looking good so far.

      posted in Pythonista
      omz
      omz
    • RE: [Feature Request] Pythonista built-in file picker

      I think this could be a useful addition to the dialogs module.

      posted in Pythonista
      omz
      omz

    Latest posts made by omz

    • RE: SSL: CERTIFICATE_VERIFY_FAILED during handshake

      @PrivateTech I'll look into it. The workaround in this StackOverflow answer should also work in Pythonista.

      posted in Pythonista
      omz
      omz
    • RE: What what what!! New version in TestFlight!!!

      @betafull There should be about 200 slots available now. Here's the TestFlight link:

      https://testflight.apple.com/join/qDkBu2ur

      posted in Pythonista
      omz
      omz
    • RE: Pythonista 3 3.4 (340006) beta: Can we test on Apple Silicon Macs?

      Sorry, it looks like I've only enabled this for internal testers earlier, but it should work for everyone now.

      posted in Pythonista
      omz
      omz
    • RE: What what what!! New version in TestFlight!!!

      I think the difference is because the beta was built with the iOS 16 SDK, which is apparently stricter about this. I might need to modify a couple of methods in the ui module to enforce running on the main thread, but in general, it's often a good idea to use @on_main_thread for UI stuff.

      posted in Pythonista
      omz
      omz
    • RE: Simpler way to Print Editor code to the physical Printer

      @OI You can also take a screenshot, select "Full Page" in the screenshot UI, then choose "Print" from the share menu.

      posted in Pythonista
      omz
      omz
    • RE: Pythonista 3 3.4 (340006) beta: Can we test on Apple Silicon Macs?

      This should be possible now, didn't know I needed to enable that explicitly.

      posted in Pythonista
      omz
      omz
    • RE: What what what!! New version in TestFlight!!!

      @JonB That's we call a very good surprise. Welcome back @omz

      Thanks for the welcome, everyone, and great to see you here, @cvp. I'm aware of your situation, and I fully understand if you need to focus on your health right now, but it's nevertheless great to see you helping people with Pythonista so relentlessly. I recently looked at the forum stats and saw that you are the member with (by far) the largest number of posts, and I can't say I was truly surprised because it's been amazing what you've been contributing to this community over the years, and I just want to say that I'm very grateful for that. 🙏

      @Olaf

      And seems already submitted 7 Dec, hence 48 days remaining of 3-months TestFlight period.

      Yes, the build is not brand-new. It was rejected by Apple's beta review twice, and then I didn't feel like dealing with this over the holidays, but I managed to sort it out with a friendly letter. :)

      posted in Pythonista
      omz
      omz
    • RE: Is it possible to change the Console font size?

      @OI

      Yes, that's possible, here's an example:

      import console
      console.set_font('Menlo', 20)
      
      posted in Pythonista
      omz
      omz
    • Pythonista sale (50% off) for Pi Day

      I’m guessing most people who frequent this forum already have Pythonista, but just in case you’ve been holding off, or know someone to gift it to: Pythonista is currently 50% off on the App Store, until Sunday, to celebrate Pi day (3/14).

      https://itunes.apple.com/us/app/pythonista-3/id1085978097?ls=1&mt=8

      If you want to do me a HUGE favor, please go and post a 5-star review on the App Store (scroll down in Pythonista’s settings and tap “Rate Pythonista”) – only if you really like the app, of course, but it helps a lot to have some recent reviews up there, and even just a star rating would be much appreciated. Thanks!

      posted in Pythonista
      omz
      omz
    • RE: Reverse engineering challenge to cvp

      @JonB Yes, I'm using a pregenerated keyword index, though I guess using jedi to extract docstrings could be an interesting option as well, might be more accessible than a script hook.

      posted in Pythonista
      omz
      omz