omz:forum

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

    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 1
    • Followers 2
    • Topics 49
    • Posts 315
    • Best 6
    • Controversial 0
    • Groups 0

    DavinE

    @DavinE

    6
    Reputation
    2419
    Profile views
    315
    Posts
    2
    Followers
    1
    Following
    Joined Last Online
    Location Heidelberg / Germany

    DavinE Unfollow Follow

    Best posts made by DavinE

    • RE: Ideas for Dropdown

      @cvp
      I think from the consideration it is exactly what I'm looking for and meant 😊

      Will try to implement in the near future once when I have questions I'll get back to you here (but may take a while at the moment a lot of stress)

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

      @7upser said:

      @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')
      

      Thats nice xD
      Thanks

      posted in Pythonista
      DavinE
      DavinE
    • RE: Pythonista Text underscore

      @mikael said:

      @DavinE, from some hints online I gather that the underlining might be connected to user having activated ”Button Shapes” in accessibility settings.

      No clue what that might be in German, but at least I have the setting under Accessibility > Display and text size (4th option) > Button Shapes (3rd option).

      omg.... but Thanks this is right....

      @7upser said:

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

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

      Ich danke dir xD
      was haben die bitte genommen ^^ Tastenformen......
      weiste wie lange ich danach gesucht hatte....

      aber schön das ich nix änder muss ^^

      posted in Pythonista
      DavinE
      DavinE
    • RE: ui.View Update

      @mikael said:

      @DavinE, could not find a better way to make this reliable than requiring an explicit call to start_scripter, see example below (requires update).

      import ui
      from scripter import script, start_scripter
      
      mainview = ui.View(name='scripter_view', bg_color='black')
      start_scripter(mainview)
      
      ...
      

      @mikael, It works Perfect!
      Thanks for your help and work into it!

      posted in Pythonista
      DavinE
      DavinE
    • RE: Ui SearchBar

      i found my solution ;)
      Code above works!

      posted in Pythonista
      DavinE
      DavinE
    • RE: Pythonista View (question)

      Thanks @mikael for that great Support here Thumbs Up

      posted in Pythonista
      DavinE
      DavinE

    Latest posts made by DavinE

    • RE: Pythonista / Tkinter

      My question would be rather what to do best, with Pythonista (if that continues now after all) or start over with Tkinter for computers

      posted in Pythonista
      DavinE
      DavinE
    • Pythonista / Tkinter

      Hello all,
      I landed after some time once again here and have seen there is a new version ? Pythonista has not died after all ?

      I am thinking after years of work on my app (which I need for my work) to start again with for example Tkinter.

      I would like to hear your opinion about what you want to do.

      EDIT:
      @omz, kann ich vllt. auch einen Zugang für eine Beta bekommen ?

      posted in Pythonista
      DavinE
      DavinE
    • RE: Run IOS project on RaspberryPI

      @Redbull said in Run IOS project on RaspberryPI:

      Therefore, technically, it might be possible to run MacOS on a Raspberry Pi, if somebody created a user-friendly way to do so. But legally, you absolutely can't do this, as Raspberry Pi hardware is not supported by Apple. But don't worry. If you can't make it, fake it with Twister OS.

      Then read exactly what Twister OS does....

      posted in Pythonista
      DavinE
      DavinE
    • RE: Connect to MariaDB

      @jgrincho

      This is my working code with MariaDB on a Synology

      import mysql.connector
      
      #FUNKTION Class main
      class main():
          #FUNKTION __init__
          def __init__(self):
              self.MySQL_tests()
      
          #FUNKTION MariaDB
          def MariaDB(self):
              try:
                  self.connection_SQL = mysql.connector.connect(
                      user = 'username',
                      password = 'Passwd in base64!',
                      host = 'ip adresse',
                      port = 3307,
                      database = 'database',
                      autocommit = True
                  )
              except mysql.connector.Error as e:
                  print(e)
              self.cursor_SQL = self.connection_SQL.cursor()
      
          #FUNKTION MySQL_tests
          def MySQL_tests(self):
              self.MariaDB()
              try:
                  self.cursor_SQL.execute(
                      """
                      SELECT device_ID, role, mail
                      FROM users
                      WHERE Name = %s
                      """,
                      [
                          'Test'
                      ],
                  )
                  print(self.cursor_SQL.fetchone())
              except mysql.connector.Error as e:
                  print(e)
              finally:
                  self.cursor_SQL.close()
                  self.connection_SQL.close()
                  
      if __name__ == '__main__':
          main()
      
      posted in Pythonista
      DavinE
      DavinE
    • Run IOS project on RaspberryPI

      Hello all,
      Is it possible to run the Pythonista project on a RaspberryPI without much effort ?

      posted in Pythonista
      DavinE
      DavinE
    • RE: Connect to MariaDB

      @jgrincho,
      Did you get it to work?
      For me it runs without problems.

      posted in Pythonista
      DavinE
      DavinE
    • RE: Wait_modal speed

      @JonB Thanks, this helps me today ;)

      posted in Pythonista
      DavinE
      DavinE
    • RE: Camera

      @cvp, @ccc
      Thank you very much, try; except I had not thought 🙈

      posted in Pythonista
      DavinE
      DavinE
    • Camera

      Hi guys,

      I have a problem when using the camera.
      I have used the following code which I had from here:

      def scanner_app(self, label_text):
              #FUNKTION captureOutput_didOutputMetadataObjects_fromConnection_
              def captureOutput_didOutputMetadataObjects_fromConnection_(_self, _cmd, _output, _metadata_objects, _conn):
                  global scannerCode
                  objects = ObjCInstance(_metadata_objects)
                  for obj in objects:
                      s = str(obj.stringValue())
                      if s not in scannerCode:
                          scannerCode = s
                  scannerView.close()
      
              global scannerCode
              scannerCode = ''
      
              AVCaptureSession = ObjCClass('AVCaptureSession')
              AVCaptureDevice = ObjCClass('AVCaptureDevice')
              AVCaptureDeviceInput = ObjCClass('AVCaptureDeviceInput')
              AVCaptureMetadataOutput = ObjCClass('AVCaptureMetadataOutput')
              AVCaptureVideoPreviewLayer = ObjCClass('AVCaptureVideoPreviewLayer')
              dispatch_get_current_queue = c.dispatch_get_current_queue
              dispatch_get_current_queue.restype = c_void_p
              
              MetadataDelegate = create_objc_class('MetadataDelegate', methods=[captureOutput_didOutputMetadataObjects_fromConnection_], protocols=['AVCaptureMetadataOutputObjectsDelegate'])
              
              delegate = MetadataDelegate.new()
              scannerView = ui.View(frame=(0, 0, self.WIDTH, self.HEIGHT))
              scannerView.name = 'QR Code Scannen'
              session = AVCaptureSession.alloc().init()
              device = AVCaptureDevice.defaultDeviceWithMediaType_('vide')
              _input = AVCaptureDeviceInput.deviceInputWithDevice_error_(device, None)
              if _input:
                  session.addInput_(_input)
              else:
                  print('Failed to create input')
                  return
              output = AVCaptureMetadataOutput.alloc().init()
              queue = ObjCInstance(dispatch_get_current_queue())
              output.setMetadataObjectsDelegate_queue_(delegate, queue)
              session.addOutput_(output)
              output.setMetadataObjectTypes_(output.availableMetadataObjectTypes())
              prev_layer = AVCaptureVideoPreviewLayer.layerWithSession_(session)
              prev_layer.frame = ObjCInstance(scannerView).bounds()
              prev_layer.setVideoGravity_('AVLayerVideoGravityResizeAspectFill')
              ObjCInstance(scannerView).layer().addSublayer_(prev_layer)
              label = ui.Label(frame=(0, 0, self.WIDTH, 30), flex='W', name='label')
              label.background_color = (0, 0, 0, 0.5)
              label.text_color = '#ffffff'
              label.text = label_text
              label.alignment = ui.ALIGN_CENTER
              scannerView.add_subview(label)
              session.startRunning()
              scannerView.present('fullscreen')
              scannerView.wait_modal()
              session.stopRunning()
              delegate.release()
              session.release()
              output.release()
              scannerView.close()
              return scannerCode 
      

      As you can see in this video:
      https://imgur.com/a/VDNN8A1

      Crashes the camera immediately call again....
      The problem I have with an iPhone 11 Pro IOS 15.6.1 on my other iPhone XS IOS 15.6.1 it goes without problems....

      Maybe someone can take a look at the problem and help me.

      Thanks in advance!

      posted in Pythonista
      DavinE
      DavinE
    • RE: Correct iPad Screen Size

      @cvp said:

      @DavinE please, try as method of an ui.View

      	def get_screen_size(self):				
      		app = UIApplication.sharedApplication().keyWindow() 
      		for window in UIApplication.sharedApplication().windows():
      			ws = window.bounds().size.width
      			hs = window.bounds().size.height
      			break
      		return ws,hs
      

      @cvp my friend, this works wonderfully

      Thanks a lot :D

      posted in Pythonista
      DavinE
      DavinE