omz:forum

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

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

    runjaj

    @runjaj

    9
    Reputation
    1054
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    runjaj Unfollow Follow

    Best posts made by runjaj

    • How to use pytest (level beginner)

      Hi!

      My knowledge of Python and Pythonista is frankly low. Maybe you'll find this too easy and evident, but I've needed sometime to understand how to use pytest in Pythonista.

      Here is an script showing how to use it:

      import pytest
      
      def cuadrado(x):
          return x*x
      
      def test():
          assert(cuadrado(2)==5)
          
      pytest.main()
      

      Just import pytest and import or define your functions. Then, define your test and, finally, put pytest.main() to run the tests. That last line was the thing I couldn't find when I was reading the pytest tutorial.

      Javier
      Ps. Sorry for the bad English.

      posted in Pythonista
      runjaj
      runjaj
    • RE: Is pandas supported on pythonista ?

      Another option would be Carnets. It's a free (as in beer and as in speech) Jupyter notebook implementation for iOS. It has pandas, numpy, sympy, matplotlib and more. It's a pretty impressive piece of software.

      posted in Pythonista
      runjaj
      runjaj
    • RE: A full book of Pythonista?

      Hi!

      If Ole organized a crowdfunding to get some money to write the book, I'll be more than happy to pay a reasonable amount.

      Javier

      posted in Pythonista
      runjaj
      runjaj
    • RE: [Solved] Use the numeric keyboard easily

      Hi!

      I contacted Ole via Twitter and he solved the problem. It's really easy, but there are a couple of things that are not so evident (at least, for me).

      To use a numeric keyboard with a textField created using the UI Designer you need to write in the Custom Attributes field:

      {"keyboard_type": ui.KEYBOARD_DECIMAL_PAD}

      Alternatively, you can write:

      dict(keyboard_type=ui.KEYBOARD_DECIMAL_PAD)

      I think the second is easier to write in iOS. The first one has one problem: the quotation marks. By default iOS changes the straight " " to typographic ones. The problem is that Pythonista cannot understand typographic quotation marks. You can get straight quotation marks by tapping and holding the ["] key.

      I hope it's clear now (and that you could understand my not-so-good English).

      Javier

      Edit (27 June 2018): It's possible to change several attributes in one line. For example, here we change the keyboard to a decimal pad and make the Clear Button visible always:

      {"keyboard_type" : ui.KEYBOARD_DECIMAL_PAD, "clear_button_mode" : "always"}

      posted in Pythonista
      runjaj
      runjaj

    Latest posts made by runjaj

    • RE: Is pandas supported on pythonista ?

      Another option would be Carnets. It's a free (as in beer and as in speech) Jupyter notebook implementation for iOS. It has pandas, numpy, sympy, matplotlib and more. It's a pretty impressive piece of software.

      posted in Pythonista
      runjaj
      runjaj
    • Workflow to create presentations using Remark

      Sometime ago I created a workflow to create a quick and easy presentation using markdown and Remark. Just create the presentation using markdown and use this workflow to view it. No need to install anything.

      The Remark syntax is really easy and is available in the Remark website.

      posted in Editorial
      runjaj
      runjaj
    • RE: What is the loop for the scene module??? Why is the documentation so sparse????

      Documentation could be improved, no questions here.

      Tips for a beginner (like me)?

      1. Read the documentation twice. Many times this won't solve your doubts (I know it doesn't solve mine).

      2. Check the Examples folder. I have learnt more than a few things reading them.

      3. Look for answers here and make questions. Probably you will get an answer.

      I have said in this forum that I would like that Ole wrote better documentation and would happily participate in a crowdfunding, if he organized it. I understand that writing good documentation requires time and time is money...

      posted in Pythonista
      runjaj
      runjaj
    • RE: In my app, users only enter numbers. Change keyboard to numeral-friendly?

      Hi!

      I'm the guy who asked https://forum.omz-software.com/topic/4930/use-the-numeric-keyboard-easily

      I have posted there how to change the type of keyboard using the UI Designer. It's super easy (once you know how to do it. I had to ask Ole).

      I hope it helps.

      Javier

      posted in Pythonista
      runjaj
      runjaj
    • RE: [Solved] Use the numeric keyboard easily

      Hi!

      I contacted Ole via Twitter and he solved the problem. It's really easy, but there are a couple of things that are not so evident (at least, for me).

      To use a numeric keyboard with a textField created using the UI Designer you need to write in the Custom Attributes field:

      {"keyboard_type": ui.KEYBOARD_DECIMAL_PAD}

      Alternatively, you can write:

      dict(keyboard_type=ui.KEYBOARD_DECIMAL_PAD)

      I think the second is easier to write in iOS. The first one has one problem: the quotation marks. By default iOS changes the straight " " to typographic ones. The problem is that Pythonista cannot understand typographic quotation marks. You can get straight quotation marks by tapping and holding the ["] key.

      I hope it's clear now (and that you could understand my not-so-good English).

      Javier

      Edit (27 June 2018): It's possible to change several attributes in one line. For example, here we change the keyboard to a decimal pad and make the Clear Button visible always:

      {"keyboard_type" : ui.KEYBOARD_DECIMAL_PAD, "clear_button_mode" : "always"}

      posted in Pythonista
      runjaj
      runjaj
    • [Solved] Use the numeric keyboard easily

      Hello!

      I've created a very simple app to solve an small problem I have. The app works really well.

      The app has a couple of text fields. These fields are numbers and I would like to use a numeric keyboard instead of the regular keyboard. I have created the ui using the UI Designer. Is there an easy way to do it? If it is too difficult (more than two lines of code), it isn't a big deal to change the keyboard when I'm using the app...

      Sadly, my knowledge is very limited and I'm not able to understand half of the help. I have searched the forum and the internet looking for examples I could use, but no luck.

      Thanks!

      Javier

      posted in Pythonista
      runjaj
      runjaj
    • How to use pytest (level beginner)

      Hi!

      My knowledge of Python and Pythonista is frankly low. Maybe you'll find this too easy and evident, but I've needed sometime to understand how to use pytest in Pythonista.

      Here is an script showing how to use it:

      import pytest
      
      def cuadrado(x):
          return x*x
      
      def test():
          assert(cuadrado(2)==5)
          
      pytest.main()
      

      Just import pytest and import or define your functions. Then, define your test and, finally, put pytest.main() to run the tests. That last line was the thing I couldn't find when I was reading the pytest tutorial.

      Javier
      Ps. Sorry for the bad English.

      posted in Pythonista
      runjaj
      runjaj
    • RE: A full book of Pythonista?

      Hi!

      If Ole organized a crowdfunding to get some money to write the book, I'll be more than happy to pay a reasonable amount.

      Javier

      posted in Pythonista
      runjaj
      runjaj