omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. sulcud
    3. Best

    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 7
    • Posts 34
    • Best 4
    • Controversial 0
    • Groups 0

    Best posts made by sulcud

    • RE: XML/XSLT

      @flipflap, I know this is not WebView based but I hope it also helps you to execute the JavaScript you need

      import objc_util
      
      
      class JavaScriptVM(object):
      	def __init__(self):
      		self._framework = objc_util.load_framework("JavaScriptCore")
      		self._JSContext = objc_util.ObjCClass("JSContext")
      		self._JSVirtualMachine = objc_util.ObjCClass("JSVirtualMachine")
      		self.context = None
      		self.javascript_vm = None
      		
      		self._prepare_vm()
      
      	def _prepare_vm(self):
      		context = self._JSContext.new()
      		self.javascript_vm = self._JSVirtualMachine.new()
      		self.context = context.initWithVirtualMachine_(self.javascript_vm)
      		
      	def evaluate_script(self, script_code: str):
      		if self.context is not None:
      			if self.javascript_vm is not None:
      				return self.context.evaluateScript(script_code)
      
      
      code = """function test(a, b){
      	return a + b;
      }
      test(1+2, 3)+3"""
      vm = JavaScriptVM()
      r = vm.evaluate_script(code)
      print(r) 
      
      posted in Pythonista
      sulcud
      sulcud
    • RE: Wish list for post 3.3...

      Up to date pre-installed modules

      posted in Pythonista
      sulcud
      sulcud
    • RE: Can't install pyttsx3 module

      I think that erasing a Pythonista build-in module is not possible, remember that python has a weird importing system so if you have a script/folder called speech in the same folder of your main script maybe you are importing it instead of the build in one. (python import order is: current dir, ... , site-packages, build-in) but If that is not the case, I think a fresh install of Pythonista could work

      posted in Pythonista
      sulcud
      sulcud
    • RE: FTP communication

      @mikael You are right, FTP is completely insecure, and yes paramiko is perfect for secure communication, but I am doing a FTP Server from scratch because I want to understand how it works inside

      posted in Pythonista
      sulcud
      sulcud