omz:forum

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

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

    uj_jonas

    @uj_jonas

    Yes I'm 15, so please bare with me while I try to learn Python. I'm also from Denmark, so English isn't even my native language.

    Luckily @omz created this amazing app, which honestly have help me learn more than any website like Codecademy.com or Udemy.com

    1
    Reputation
    1452
    Profile views
    21
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Age 6

    uj_jonas Unfollow Follow

    Best posts made by uj_jonas

    • RE: How do you get full error messages?

      Unfold the pink sheet and press "print traceback" then go into the console

      posted in Pythonista
      uj_jonas
      uj_jonas

    Latest posts made by uj_jonas

    • RE: How do you get full error messages?

      Unfold the pink sheet and press "print traceback" then go into the console

      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: WebView not allowing me to scroll to the bottom right corner

      @Cethric thanks. Didn't even think of that

      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: WebView not allowing me to scroll to the bottom right corner

      @ccc said:

      import ui
      main = ui.ScrollView(frame=(0, 0, *ui.get_screen_size()))
      main.content_size = (1920, 1080)
      wv = ui.WebView(frame=(0, 0, *main.content_size))
      wv.load_url('http://www.example.com')
      main.add_subview(wv)
      main.present()

      Can I do this and still have the wv_container? I kinda need my webview inside a separate view :/

      posted in Pythonista
      uj_jonas
      uj_jonas
    • WebView not allowing me to scroll to the bottom right corner

      I have an iPad 4 with 720p resolution. When I run this code, the webview prevents me from scrolling to the right.

      import ui
      
      main = ui.View(frame=(0, 0, ui.get_screen_size()[0], ui.get_screen_size()[1]))
      wv_container = ui.View(frame=(0, 0, 1920, 1080))
      wv = ui.WebView(frame=wv_container.frame)
      wv.load_url('http://www.example.com')
      
      wv_container.add_subview(wv)
      main.add_subview(wv_container)
      main.present('fullscreen')
      
      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: Get web source code

      So I know the question has been answered, but I just wanted to share this. It's just another approach.

      import ui, appex
      class wvdelegate(object):
      	def webview_did_finish_load(self, webview):
      		html = webview.eval_js('document.documentElement.innerHTML')
      		webview.load_html('<xmp>' + html + r'<\xmp>')
      		webview.delegate = None
      wv = ui.WebView()
      wv.load_url(appex.get_url())
      wv.delegate = wvdelegate()
      wv.present()
      

      You could also do like this to copy the HTML

      import ui, appex, clipboard
      class wvdelegate(object):
      	def webview_did_finish_load(self, webview):
      		self.html = webview.eval_js('document.documentElement.innerHTML')
      		webview.load_html('<xmp>' + self.html + r'<\xmp>')
      		webview.delegate.webview_did_finish_load = None
      		wv.right_button_items = [ui.ButtonItem(image=ui.Image('iob:clipboard_32'), action=lambda x: clipboard.set(wv.delegate.html))]
      wv = ui.WebView()
      wv.load_url(appex.get_url())
      wv.delegate = wvdelegate()
      wv.present()
      
      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: pdfkit PermissionError

      Aww :/

      Well thanks for answering

      posted in Pythonista
      uj_jonas
      uj_jonas
    • pdfkit PermissionError

      I wanted to convert HTML to PDF and looked it on Google. I found the pdfkit docs, but when I tried using it

      import pdfkit
      
      pdfkit.from_url('https://google.com', sys.argv[0][:-7] + 'out.pdf')
      

      I got a PermissionError

      My guess is it's just iOS restricting me, but I'd like to know if I'm doing something wrong.

      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: [Share]CSS Color Selector/Picker Wrench utility

      Awesome :D definitely going to be using this. I just made a few changes to it, so that it writes it in the editor directly instead of copying it to the clipboard.

      Also, I just have to know, what keyboard are you using?

      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: Gives an error at the line that I marked.

      @happy_variable
      I don't know why you get that error, but try appex.get_attachments()[0] instead of appex.get_image()
      That did it for me :/

      Oh, and remove the str() around img on the line you get the error

      posted in Pythonista
      uj_jonas
      uj_jonas
    • RE: How do we use raw_input()?

      @NickAtNight Yes. In Python 3 print is a function.
      If you want to run your script to run in Python 2 you could add
      #! python2 at the top of your script like this:

      #! python2
      
      var = raw_input('using raw_input()')
      print 'python 2 print'
      

      You can also test your script in Python 2 by holding down the play button and choosing "Run with Python 2.7"

      posted in Pythonista
      uj_jonas
      uj_jonas