• pulbrich

    @Ivan_OE I didn’t write this code, only use it. But I am happy if it helped.

    posted in Pythonista read more
  • pulbrich

    In your original code move the first closing bracket “)” to the end of the line, the idea being than in python 3.x the print statement needs the arguments in brackets, i.e.

    print(“something”)
    
    print ('All scanned codes:\n' + '\n'.join(found_codes) )
    

    should work.

    (The original code was ok in python 2.x)

    posted in Pythonista read more
  • pulbrich

    You can subclass str and insert your method in the subclass definition. As long as you use your subclass to create your “string” instances the new method would work. Not for literals though. E.g.,

    class funny_string(str):
      def clean(data):
         while data.startswith(' '): data = data[1:]
         while data.endswith(' '): data = data[:-1]
         return data
    
    my_string = funny_string(“ look at this! “)
    print(my_string.clean()) #### works
    print(“ huh? “.clean()) #### doesn’t work
    

    posted in Pythonista read more
  • pulbrich

    Then you can use re, which is the Pythonista supplied regex module.

    posted in Pythonista read more
  • pulbrich

    If I run

    import re
    
    print(re)
    
    

    I get

    <module 're' from '/var/containers/Bundle/Application/7F183C05-845F-47C3-93D3-533E30766BBB/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/re.py'>
    

    which is what it should be. Could you try these two lines of code and show the console output?

    posted in Pythonista read more
  • pulbrich

    Try

    import re
    

    You cannot upgrade numpy, the available version is part of the Pythonista app, not user upgradable.

    posted in Pythonista read more
  • pulbrich

    Louder, please.

    posted in Pythonista read more
  • pulbrich

    It’s a uiView property, supposed to regulate the behavior of a view’s subviews.

    Instance Property
    clipsToBounds
    A Boolean value that determines whether subviews are confined to the bounds of the view.
    

    posted in Pythonista read more
  • pulbrich

    @ProgrammingGo if you ever need to penetrate the domain of various coordinate system representations (angles included) I recommend you look at Pyrr

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!