• DaveClark

    Hello

    I saw this a while ago

    How I use Python to blog my iPhone

    https://forum.omz-software.com/topic/4953/how-i-use-python-to-blog-my-iphone

    posted in Pythonista read more
  • DaveClark

    Hello

    The book "Doing Math With Python" has a chapter on drawing shapes and Fractals. Also some Mandelbrot stuff. I like this book because of the different examples.

    Good luck on your quest

    posted in Pythonista read more
  • DaveClark

    Here is the Pyui file

    Whoops5test.pyui

    [
      {
        "nodes" : [
          {
            "nodes" : [
              {
                "nodes" : [
    
                ],
                "frame" : "{{0, 0}, {540, 133}}",
                "class" : "Label",
                "attributes" : {
                  "name" : "label1",
                  "flex" : "WH",
                  "frame" : "{{195, 254}, {150, 32}}",
                  "uuid" : "F7EB115D-61EC-419E-BB26-7CEDC7ADEBC8",
                  "class" : "Label",
                  "alignment" : "center",
                  "text" : "Shock Shaft Speed",
                  "number_of_lines" : 0,
                  "font_size" : 26,
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{0, 459}, {540, 92}}",
                "class" : "Label",
                "attributes" : {
                  "name" : "label6",
                  "flex" : "WH",
                  "frame" : "{{195, 254}, {150, 32}}",
                  "uuid" : "536B313D-8792-4912-A7F0-9ED17CEF3818",
                  "class" : "Label",
                  "alignment" : "center",
                  "text" : "answer",
                  "font_size" : 24,
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{0, 141}, {274, 60}}",
                "class" : "Label",
                "attributes" : {
                  "name" : "label2",
                  "flex" : "WH",
                  "frame" : "{{195, 334}, {150, 32}}",
                  "uuid" : "ABB867F3-B6CB-41BF-B344-621A60512C75",
                  "class" : "Label",
                  "alignment" : "left",
                  "text" : "Motion Ratio?",
                  "font_size" : 22,
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{366, 141}, {174, 60}}",
                "class" : "TextField",
                "attributes" : {
                  "uuid" : "2AFA90FE-B716-4A95-82A4-3F522A466FC2",
                  "font_size" : 17,
                  "frame" : "{{170, 334}, {200, 32}}",
                  "action" : "",
                  "alignment" : "center",
                  "autocorrection_type" : "default",
                  "text" : "1",
                  "font_name" : "<System>",
                  "spellchecking_type" : "default",
                  "class" : "TextField",
                  "name" : "textfield1",
                  "flex" : "WH"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{0, 209}, {274, 60}}",
                "class" : "Label",
                "attributes" : {
                  "name" : "label3",
                  "frame" : "{{195, 334}, {150, 32}}",
                  "uuid" : "2EE9FFC0-FCF1-4996-8449-2A8C8DA8934C",
                  "class" : "Label",
                  "alignment" : "left",
                  "text" : "Whoop Height in inches?",
                  "font_size" : 22,
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{0, 278}, {274, 60}}",
                "class" : "Label",
                "attributes" : {
                  "name" : "label4",
                  "frame" : "{{195, 334}, {150, 32}}",
                  "uuid" : "DFF299B2-0881-46DC-AEF9-7EB993E46A2B",
                  "class" : "Label",
                  "alignment" : "left",
                  "text" : "Whoop Spacing in inches?",
                  "font_size" : 22,
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{0, 346}, {274, 60}}",
                "class" : "Label",
                "attributes" : {
                  "name" : "label5",
                  "frame" : "{{195, 334}, {150, 32}}",
                  "uuid" : "599966B1-4F08-45EE-ABD8-B8D9A75AA37E",
                  "class" : "Label",
                  "alignment" : "left",
                  "text" : "Vehicle Speed in mph?",
                  "font_size" : 22,
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{366, 208}, {174, 62}}",
                "class" : "TextField",
                "attributes" : {
                  "flex" : "WH",
                  "font_name" : "<System>",
                  "frame" : "{{170, 334}, {200, 32}}",
                  "spellchecking_type" : "default",
                  "class" : "TextField",
                  "uuid" : "2AFA90FE-B716-4A95-82A4-3F522A466FC2",
                  "alignment" : "center",
                  "text" : "15",
                  "autocorrection_type" : "default",
                  "name" : "textfield2",
                  "font_size" : 17
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{366, 278}, {174, 60}}",
                "class" : "TextField",
                "attributes" : {
                  "flex" : "WH",
                  "font_name" : "<System>",
                  "frame" : "{{170, 334}, {200, 32}}",
                  "spellchecking_type" : "default",
                  "class" : "TextField",
                  "uuid" : "2AFA90FE-B716-4A95-82A4-3F522A466FC2",
                  "alignment" : "center",
                  "text" : "15",
                  "autocorrection_type" : "default",
                  "name" : "textfield3",
                  "font_size" : 17
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{366, 346}, {174, 60}}",
                "class" : "TextField",
                "attributes" : {
                  "flex" : "WH",
                  "font_size" : 17,
                  "frame" : "{{170, 334}, {200, 32}}",
                  "spellchecking_type" : "default",
                  "class" : "TextField",
                  "uuid" : "2AFA90FE-B716-4A95-82A4-3F522A466FC2",
                  "alignment" : "center",
                  "text" : "40",
                  "autocorrection_type" : "default",
                  "name" : "textfield4",
                  "font_name" : "<System>"
                },
                "selected" : false
              },
              {
                "nodes" : [
    
                ],
                "frame" : "{{195, 586}, {168, 55}}",
                "class" : "Button",
                "attributes" : {
                  "flex" : "WH",
                  "action" : "",
                  "frame" : "{{230, 334}, {80, 32}}",
                  "title" : "Calculate",
                  "uuid" : "EA291EB5-371B-4AAE-A3D4-31BE3D10ACC5",
                  "class" : "Button",
                  "name" : "button1",
                  "font_size" : 22
                },
                "selected" : true
              }
            ],
            "frame" : "{{0, 0}, {540, 500}}",
            "class" : "ScrollView",
            "attributes" : {
              "flex" : "HRTB",
              "frame" : "{{110, 110}, {320, 320}}",
              "uuid" : "E616DE17-915E-41B3-BA80-AB2043AC2DDB",
              "content_height" : 720,
              "class" : "ScrollView",
              "content_width" : 540,
              "name" : "scrollview1"
            },
            "selected" : true
          }
        ],
        "frame" : "{{0, 0}, {540, 540}}",
        "class" : "View",
        "attributes" : {
          "enabled" : true,
          "background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
          "tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
          "border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
          "flex" : ""
        },
        "selected" : false
      }
    ]
    

    posted in Pythonista read more
  • DaveClark

    Thanks for your help. Here is the code

    Whoops5.py

    import ui
    from SetTextFieldPad import SetTextFieldPad
    
    
    
    def getInput(view):
        textfield = v[view]
        input = textfield.text
        return input
    
    def calculate(motion, height, spacing, speed): 
        result = repr(round(motion * (height/(spacing*12/3/speed) / .0568))) + ' inches per second'   
        return result
    
    def button_tapped(sender):
        motion = float(getInput('textfield1'))
        height = float(getInput('textfield2'))
        spacing = float(getInput('textfield3'))
        speed = float(getInput('textfield4'))
        
        v['label6'].text = calculate(motion, height, spacing, speed) 
    
    
    
    #SetTextFieldPad(v['textfield1'])
    #SetTextFieldPad(v['textfield2'])
    #SetTextFieldPad(v['textfield3'])
    #SetTextFieldPad(v['textfield4'])
    
    v = ui.load_view('whoops5test')
    #button1.action = button_tapped
    button1 = v['button1']
    
    
    v.present('sheet')```
    
    Next I’ll send the Pruitt file

    posted in Pythonista read more
  • DaveClark

    the standard keyboard does come up and works. I am using the stock one for now.. Your keyboard has worked great on my other stuff that does not use a scrollview. I could put my code, but its the pyui file that I think needs work. or acutally, I need to code the scollview in the UI designed GUI, maybe. I dont know how to post the pyui file along with the py file

    posted in Pythonista read more
  • DaveClark

    Hello All

    I have a calculation thing that I did with the UI designer. It has four textfields and one button. It worked great, but one thing I did not like. When the keypad is up (the one cvp did, which is awesome) it blocked part of the form. I redid it with a scrollview to try to get it to scroll. I put the lables and the textfields and the button on the scrollview. Now it looks good and scrolls but now my code doesn’t connect to the UI interface. It does not read the button action or the text fields. I think I need to add a sub_view to the scrollview. I do not know for sure.

    Any help would be very much appreciated

    posted in Pythonista read more
  • DaveClark

    @cvp Oh my God. That’s it, You should see the mess I have got going in trying to incorporate your keypad. I guess I don’t get it yet, but I’m trying.

    Thank you so much for your help, and thank you for taking the time to help. I really enjoy the little programming projects I have and I am getting there

    Thanks again

    posted in Pythonista read more
  • DaveClark

    I have something that works on a iPad, but I would like to incorporate the new number pad in the program. This is where I’m at

    import ui
     
    def getInput(view):
        textfield = v[view]
        input = textfield.text
        return input
          
    def calculate(top, bottom): 
        result = repr(round(1/(1/top + 1/bottom))) + ' pounds per inch'   
        return result
        
    def button_tapped(sender):
        top = float(getInput('textfield1'))
        bottom = float(getInput('textfield2'))
        v['textfield3'].text = calculate(top, bottom) 
            
    v = ui.load_view('uitest')
    
    v['textfield1'].keyboard_type = ui.KEYBOARD_DECIMAL_PAD   
    v['textfield2'].keyboard_type = ui.KEYBOARD_DECIMAL_PAD  
     
    button1 = v['button1']
    button1.action = button_tapped
    v.present('sheet')
    

    How would I make your keypad be the default keypad.

    Any help would be very much appreciated

    posted in Pythonista read more
  • DaveClark

    Hello

    I just tried your program and it seems to work. iphone 6 plus, ios 11.4, pythonista 3.2

    I didn't know about your lexical stuff, it looks pretty cool

    posted in Pythonista read more
  • DaveClark

    @cvp Thank you for your help and quick answer on adding the decimal point to your keypad

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!