• pulbrich

    @vignesh : if you want to use SceneKit in a more convenient way, there is a Pythonista wrapper with plenty of examples here:

    posted in Pythonista read more
  • 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

Internal error.

Oops! Looks like something went wrong!