• ccc

    In a recent CppCast interview, Herb Sutter describes how he would change C/C++ types if he could go back in time. This is almost exactly how things were changed from Python 2 to Python 3 (str split into Unicode strings and byte arrays)

    posted in Pythonista read more
  • ccc

    My recollection is that person.image_data was not present in the original version of the contacts module but was added later. That is why it is not in the webpage docs but is in the in-the-app docs. I also think the workaround code was published before person.image_data was added to the module.

    With the current module, I believe that you can do it all without ObjC.

    posted in Pythonista read more
  • ccc

    You might also open an issue in the module’s repo to help the maintainers know about Pythonista and its unique needs. Someone in that community might have already made the combination work.

    posted in Pythonista read more
  • ccc

    To view doc in app, switch to console the click on the ? icon at upperleft.

    posted in Pythonista read more
  • ccc

    There is a #editorial channel in the Pythonista Slack.

    posted in Editorial read more
  • ccc

    Do you really need ObjC to do these thing? Why not just use the contacts module?

    posted in Pythonista read more
  • ccc

    """Bariatric Math Calculations"""
    
    try:
        raw_input
    except NameError:  # Python 3
        raw_input = input
    
    weight_lbs = int(raw_input('what is your current weight (lbs): '))
    height_ft = int(raw_input('what is your current height in feet: '))
    height_inches = int(raw_input('You are ' + str(height_ft) + ' feet and how many inches: '))
    previous_bariatrics = 0
    
            
    
    def Weight_Convert_Kg(weight_lbs):
        x = weight_lbs / 2.204
        return x
    weight_kg  = int(Weight_Convert_Kg(weight_lbs))
        
    def Total_Height_Inches(height_ft, height_inches):
        x = (height_ft * 12) + height_inches
        return x
    total_height_inches = int(Total_Height_Inches(height_ft, height_inches))
                    
    def Height_Convert_Meters(total_height_inches):
        x = total_height_inches * 0.0254
        return x
    height_meters = Height_Convert_Meters(total_height_inches)
    height_meters = round(height_meters, 2)
        
    
    def Calc_Bmi(weight_kg, height_meters):
        x = weight_kg / (height_meters ** 2)
        return x
    BMI = int(Calc_Bmi(weight_kg, height_meters))
        
    def Weight_Convert_lbs(weight_kg):
        x = weight_kg * 2.204
        return x
    calc_weight_lbs = int(Weight_Convert_lbs(weight_kg))
    
    def Ibw_man (total_height_inches):
        x = 50 + (2.3 *(total_height_inches - 60))
        return x
    ideal_body_wt_man = int(Ibw_man(total_height_inches) * 2.204)
    
        
    def Ibw_woman(total_height_inches): 
        x = 45.5 + (2.3 *(total_height_inches - 60))
        return x 
    ideal_body_wt_woman = int(Ibw_woman(total_height_inches) * 2.204)
    
        
        
    print("kg: ", weight_kg)
    print("inches: ", total_height_inches)
    print("meters: ", height_meters)
    print("bmi: ", BMI)
    print("IBWm: ", ideal_body_wt_man)
    print("IBWw: ", ideal_body_wt_woman)
    

    posted in Pythonista read more
  • ccc

    You might be able to streamline your code with something like:

    def make_button(title, frame, background_color):
        return ui.Button(title=title,
                         frame=frame,
                         background_color=background_color,
                         font=('<System-Bold>', 20),
                         border_width=2,
                         corner_radius=5,
                         action=button_tapped)
    

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!