omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. 7upser

    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 0
    • Topics 1
    • Posts 43
    • Best 14
    • Controversial 0
    • Groups 0

    7upser

    @7upser

    17
    Reputation
    815
    Profile views
    43
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    7upser Unfollow Follow

    Best posts made by 7upser

    • RE: SFSymbols?

      If someone interested in a list of string, here we go

      import plistlib
      import io
      
      vFilePath = '/System/Library/CoreServices/CoreGlyphs.bundle/symbol_order.plist'
      
      with open(vFilePath, 'rb') as vFile:
      	vFileObject = io.BytesIO(vFile.read())
      vJsonSFSymbols = plistlib.load(vFileObject)
      
      for vIndex, vJsonSFSymbol in enumerate(vJsonSFSymbols):
      	print(str(vIndex).zfill(4), vJsonSFSymbol)
      
      posted in Pythonista
      7upser
      7upser
    • RE: Pythonista block Phone calls / WhatsApp call

      @cvp It wasn't my Thread 😛

      But you are right Phone calls and WhatsApp are different things.
      Maybe there is a url scheme for whats app, or a action for Shortcuts.

      But back to what i'm interested in (call shortcut and return to pythonista)
      This could work:

      import ui
      import webbrowser
      
      class cUIView(ui.View):
      	def __init__(self, *args, **kwargs):
      		self.width, self.height = 200, 200
      		self.background_color = 'silver'
      		
      		self.vBtn = ui.Button(title = 'test', name = 'btntest')
      		self.vBtn.frame = (50, 50, 100, 100)
      		self.vBtn.background_color = 'white'
      		self.vBtn.action = self.btnAction
      		self.add_subview(self.vBtn)
      		
      	def btnAction(self, vSender):
      		url = 'shortcuts://x-callback-url/run-shortcut?name=testBluetoothOff&x-success=pythonista3://'
      		webbrowser.open(url)
      
      vView = cUIView()
      vView.present('sheet')
      
      posted in Pythonista
      7upser
      7upser
    • RE: Pythonista Text underscore

      In german its named: Tastenformen
      (einstellungen / bedienungshilfen / anzeige & textgröße / tastenformen)

      Never heard this before, i think Apple create a new word....

      posted in Pythonista
      7upser
      7upser
    • RE: Print superscript characters in Python

      You can also add Unicode superscripts to the characters: \u00B2
      for more information see here: Wikipedia

      Result is something like this:

      print(''.join('m/s' + '\u00B2'))
      print('m/s\u00B2')
      
      posted in Pythonista
      7upser
      7upser
    • RE: Trouble with Unicode

      You can test the ios font and their glyphs with a short script:

      from objc_util import *
      
      UIFont = ObjCClass('UIFont')
      vObjCAllFontNames = []
      vObjCFontFamilieNames = UIFont.familyNames()
      for vObjCFontFamilieName in vObjCFontFamilieNames:
      	vObjCFontNamesWithinFamily = UIFont.fontNamesForFamilyName_(vObjCFontFamilieName)
      	vObjCAllFontNames += vObjCFontNamesWithinFamily
      
      vFontFamilieNames = []
      vAllFontNames = []
      
      for vTemp in vObjCFontFamilieNames:
      	vFontFamilieNames.append(str(vTemp))
      for vTemp in vObjCAllFontNames:
      	vAllFontNames.append(str(vTemp))
      
      vAllFontNames.sort()
      for vFont in vAllFontNames:
      	vConsoleFont = [(vFont, 20), (0, 0, 0)]
      
      	console.set_font(vConsoleFont[0][0], vConsoleFont[0][1])
      	console.set_color(vConsoleFont[1][0], vConsoleFont[1][1], vConsoleFont[1][2])
      
      	print(vConsoleFont[0][0])
      	print(u'\u0048\u0065\u006c\u006c\u006f \u0057\u006f\u0072\u006c\u0064\u003a \u10c5\u10c7\u10cd\u10d0\u000a')
      
      console.set_font()
      console.set_color(0.00, 0.00, 0.00)
      
      

      Maybe this is a help for you, but i didn't test it.
      FontInstaller

      posted in Pythonista
      7upser
      7upser
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      This works for me, the script is in This iPad/dir:

      tag

      The iCloud Path should be:
      /private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents

      but i dont use parameter

      Edit:
      Did a test for parameter with url scheme:
      see here: Pythonista Url scheme

      tag

      works too

      posted in Pythonista
      7upser
      7upser
    • RE: Natural sorting of values in nested dictionary

      I had a similar Problem. I need a german sorted List and locale didn't work with Pythonista. So i have to write my own Sort def. That should solve your Problem.
      But @mikael was faster than light

      
      def myOwnSort(vInput):
      	import re
      	
      	vInput = dict_nested[vInput]['sv_runinskr_trim']
      	vInNr = re.findall('\d+', vInput)
      	vInNr = int(vInNr[0]) if len(vInNr) > 0 else 0
      	vInNr = '{0:0>3}'.format(vInNr)
      	
      	vInChar = re.findall('\D+', vInput)
      	vInChar = vInChar[0] if len(vInChar) > 0 else ''
      	
      	vNewSortKey = vInNr + vInChar
      
      	return vNewSortKey
      
      
      TheOneAndOnlyNewAndPrivateSortedDictionaryWithMyOwnSortKey = sorted(dict_nested, key = myOwnSort)
      
      
      for i in TheOneAndOnlyNewAndPrivateSortedDictionaryWithMyOwnSortKey:
      	print(dict_nested[i]['sv_runinskr_trim'])
      
      
      posted in Pythonista
      7upser
      7upser
    • RE: locale.currency doesn't work

      Still not working, really?

      posted in Pythonista
      7upser
      7upser
    • RE: New to Python....

      Hi, @OkieWolf

      You can post your Code with the top right button in the forum Editor.
      </>
      This result in better formatting Code.

      To debug your Code:
      Close your UI View and click the right Button where you see the Errormessage.

      tag

      Then click on Variables

      tag

      There you can see that ang and rad are strings.
      You can also set Breakpoints by tap and Hold within the Editor.
      Or you can use a print command: print(type(rad))

      You only need to convert them to float. And the Result back to string

      arc = str(float(rad) * float(ang) * pi / 180)
      

      Edit: See you solve your Problem

      posted in Pythonista
      7upser
      7upser
    • RE: Add to Home Screen did not work

      @DaricLiu ,
      Try to reboot your device.
      We have discussed this: see here

      And i found out, it isn't the same Path twice. If you move the Script, it is old Path and new Path.

      posted in Pythonista
      7upser
      7upser

    Latest posts made by 7upser

    • RE: Pythonista block Phone calls / WhatsApp call

      @cvp It wasn't my Thread 😛

      But you are right Phone calls and WhatsApp are different things.
      Maybe there is a url scheme for whats app, or a action for Shortcuts.

      But back to what i'm interested in (call shortcut and return to pythonista)
      This could work:

      import ui
      import webbrowser
      
      class cUIView(ui.View):
      	def __init__(self, *args, **kwargs):
      		self.width, self.height = 200, 200
      		self.background_color = 'silver'
      		
      		self.vBtn = ui.Button(title = 'test', name = 'btntest')
      		self.vBtn.frame = (50, 50, 100, 100)
      		self.vBtn.background_color = 'white'
      		self.vBtn.action = self.btnAction
      		self.add_subview(self.vBtn)
      		
      	def btnAction(self, vSender):
      		url = 'shortcuts://x-callback-url/run-shortcut?name=testBluetoothOff&x-success=pythonista3://'
      		webbrowser.open(url)
      
      vView = cUIView()
      vView.present('sheet')
      
      posted in Pythonista
      7upser
      7upser
    • RE: Pythonista block Phone calls / WhatsApp call

      good argument

      posted in Pythonista
      7upser
      7upser
    • RE: Pythonista block Phone calls / WhatsApp call

      There is also an automation, when App is open.

      posted in Pythonista
      7upser
      7upser
    • RE: Speech Recognition failed

      @cvp
      uuups, sorry. I was too busy today 😇

      posted in Pythonista
      7upser
      7upser
    • RE: Speech Recognition failed

      Maybe he means a Homescreen Symbol.
      @Python567, see here, if yes:

      shortcuts
      But you need to install Pythonista for each User.

      posted in Pythonista
      7upser
      7upser
    • RE: Pythonista Text underscore

      I know tastenform but never heard the plural.
      (btw. plural is in the word tasten)
      And 'operating aids' sounds like my iPad has Aids but is still operating.😷😛

      posted in Pythonista
      7upser
      7upser
    • RE: Pythonista Text underscore

      In german its named: Tastenformen
      (einstellungen / bedienungshilfen / anzeige & textgröße / tastenformen)

      Never heard this before, i think Apple create a new word....

      posted in Pythonista
      7upser
      7upser
    • RE: Print superscript characters in Python

      You can also add Unicode superscripts to the characters: \u00B2
      for more information see here: Wikipedia

      Result is something like this:

      print(''.join('m/s' + '\u00B2'))
      print('m/s\u00B2')
      
      posted in Pythonista
      7upser
      7upser
    • RE: SFSymbols?

      I'm missing the Categories for SF Symbols.
      I think there are only Categories in the Mac App.
      I found two older version and a Screenshot for the new Gaming Cat.
      I add some cats for newer Symbols, but didn't finished.
      This is what i have (with Pythonista Symbols and Emojis)

      Icons.json

      Names of restricted Symbols are here:
      /System/Library/CoreServices/CoreGlyphs.bundle/symbol_restrictions.strings
      (also a plist file)

      posted in Pythonista
      7upser
      7upser
    • RE: SFSymbols?

      If someone interested in a list of string, here we go

      import plistlib
      import io
      
      vFilePath = '/System/Library/CoreServices/CoreGlyphs.bundle/symbol_order.plist'
      
      with open(vFilePath, 'rb') as vFile:
      	vFileObject = io.BytesIO(vFile.read())
      vJsonSFSymbols = plistlib.load(vFileObject)
      
      for vIndex, vJsonSFSymbol in enumerate(vJsonSFSymbols):
      	print(str(vIndex).zfill(4), vJsonSFSymbol)
      
      posted in Pythonista
      7upser
      7upser