• @Matteo not sure that comes from the iPhone age, but perhaps due to mine 😀
    I also got some problems, try the imports also at def module, because the script could be no more active but the def of the search button yes

    from objc_util import * import ui @on_main_thread def test(sender): import clipboard import console from objc_util import ObjCClass import re import ui
  • Hi @jonB, thanks for your reply. My request was only to understand if there is a way to force Pythonista to use the mobile network instead of the wifi when my phone is connected to a free wifi network (less secure than an encripted one), so only for security reasons.

    No problem, I will try to read on objC documentation if something already exists about it.

    Regards

  • @cvp thank you for explanation, unfortunately I have not familiarity with words like "attribute" and "method" (object-oriented programming). Anyway your code works so it is enough for me :-)
    Bye

  • If your concern is about reading confidential files (versus writing files, etc) then one option is to keep sensitive files encrypted in the app (not appgroup) folder, and have wrench items that move files in/out of that "vault". Basically you have a "lockdown" wrench item, and an "unlock" wrench item. This would be slow but probably you would only lockdown critical files.

    You would likely chmod that folder to remove execute access, preventing anyone from reading the directory.

  • @cvp Hi cvp, your solution works very well, it is curious that the solution comes from a script for Editorial app, very nice example of compatibility!
    Thank you @JonB also for .md suggestion: I played a little with it and it simplifies the navigation in a big file.

    Pythonista surprises me every day!

    Regards

  • check this one...how to share python global variable

  • @Matteo Surely when the work is done during your sleep 😂

  • @dgelessus Hi thanks for useful info about python versions, I use Python mainly (only) for scientific purposes (for work that is: calculation tools/scripts for environmental/mechanical eng. , and for hobby) and I use mainly python 2.7 for best compatibility with my scripts, that are largely ported from my fortran90 database with a very basic manual rewriting from fortran to python.
    So compatibility is for me a substantial problem. But I will begin to use python 3.6 as you suggest :-)
    Regards
    Bye

  • @ccc Hi , yes thank you, it is the right link. Do you know some differences between version 3.1.1 and 3.2 about version of built-in libraries?

    Regards
    Bye

  • Hi @JonB, thank you so much for your scripts!

    The code:

    app.keyWindow().rootViewController().showAccessoryWithAnimationDuration_(0.5)

    works well in any user button created with original StatusBarOverlay by you and with the modified version for two bars in portrait mode.

    About your new script I will try to inspect it and do some tests in order to create one long bar with 12 keys in landscape mode (with the right up corner key to show/hide the long bar).

    An other idea in my mind about user keys is the creation of a key that executes the current script opened in editor but with a pre and post processing, that is: when touching that key, 1) it executes a script "pre.py" , 2) then executes the current main script opened in editor, and 3) finally executes a script "post.py". An usage example is : I want to execute only some parts of the opened script by preprocessing it and then creates automatically an animation of several images in a folder or creates a well formatted pdf of all variables of the main current script after its execution.
    I will try to write a generic "recipe" to execute pre, main and post script, maybe next weekend, in order to have a second RUN button similar to the built-in one but with pre-post proc.

    Thank you
    Regards

  • @dgelessus Hi thank you for your help, I will try to do some tests about resetting global variables programmatically following what you suggest.

    Regards
    Bye

  • For those interested, httpimport author John Torakis is updating his library to support more features. This is the link of his project on GitHub.
    Thanks

  • @Matteo ,hey. I am the same as you I stay away from objc stuff. It's a whole other learning curve for me that I dont really want to take on. I am happy merrily going on just trying to learn Python. The code in my pythonista_startup.py come from either @omz or @JonB I think. I didn't come up with any of it.
    But it just seems to work and i normally never touch it :)

  • @Phuket2 Thanks for your answer, it is true : reality overcomes fantasy!

    And thank you all for your replies.
    Regards
    Matteo

  • Ok, anyway thank you a lot for your link!
    Regards

  • Thank you so much for your code! I've about 100 MB like you inside site-packages. You are right, 100 MB is a little % of all.
    However it is an interesting thing for me and, as a exercise, I will try to modify your code to report size of entire libraries, that is the size of the entire folder of any library and not only single file, maybe in a list from biggest to most little library.
    Thanks!

  • Hi dgelessus, thanks very much for your hint, it is the best solution and now I know a new feature of Pythonista! It is a so good solution that 'pythonista_startup.py' is always executed in this way because, like omz said, that file is executed after (or during) interpreter's initialization, that starts with every pyhton script execution like the 'shortcuts' that user can create on HOME screen of device.
    Regards,
    Matteo

  • Ok, thank you very much Phuket2 for the clarifications.
    Bye
    Matteo

Internal error.

Oops! Looks like something went wrong!