• ramvee

    Love Pythonista And Love Reddit.
    I think the biggest advantage in moving to Reddit would be getting a more intelligent search, searching in this forum is not good.
    I am no expert but i see no downside to shifting to Reddit.

    posted in Pythonista read more
  • ramvee

    HI @sulcud,
    Mindnotes app, looks interesting,
    could you please put up the english version,
    when you are free.
    Thank you

    posted in Pythonista read more
  • ramvee

    @ccc
    Beauty !

    posted in Pythonista read more
  • ramvee

    Glad To See The Forum Back..
    Lot Of Catching Up To Do ! :)
    Thank You @omz and @JonB

    posted in General Discussion read more
  • ramvee

    @Phuket2 ,
    Thank you very much for the tip.
    I would also like to thank you for your old post on the same topic at
    https://forum.omz-software.com/topic/3401/share-using-draw_snapshot-method
    which i saw after i posted this thread.
    Sometimes searching is very difficult in this forum. :)
    Take Care

    posted in Pythonista read more
  • ramvee

    @cvp ,
    Thank You Very Much, Exactly What I Wanted.. :)

    posted in Pythonista read more
  • ramvee

    HI,
    I am sure this is a basic question..
    i want the simplest way to save the puzzle generated on the console to be saved as an image.
    I tried reading through ImageContext, Image, ctx etc but failed to understand.
    Please help..

    For eg. let's say i want to save this display as an image..

    # save display
    import ui
    
    w,h = ui.get_screen_size()
    view = ui.View(name = 'Grid', bg_color=1)
    view.add_subview(ui.View(name='left', frame=(0,0,w/3,h/5), bg_color='blue'))
    view.add_subview(ui.View(name='right', frame=(w*2/3,0,w/3,h/5), bg_color='red'))
    view.present('sheet')
    

    posted in Pythonista read more
  • ramvee

    Thank you very much @ccc for your constant support and prompt help.

    Yes, I found some old file, i had named matplotlib.py ,
    I have renamed it and now everything works fine.
    Silly mistake on my part when i started with pythonista.

    posted in Pythonista read more
  • ramvee

    Hi,
    I often get "cannot import name 'pyplot' error"
    when i try to import matplotlib

    As a work around, I go to Examples folder and run any plotting example, then it works,
    after which i can import matplotlib normally.

    The error states something about "frozen importlib._bootstrap"
    How can i avoid this error, in pythonista 3

    Thank you.

    # Histogram
    # Basic plot
    import numpy as np
    import matplotlib.pyplot as plt
    height = [3, 12, 5, 18, 45]
    bars = ('A', 'B', 'C', 'D', 'E')
    y_pos = np.arange(len(bars))
    plt.bar(y_pos, height, color=(0.2, 0.4, 0.6, 0.6))
     
    # Custom Axis title
    plt.xlabel('X Axis Title', fontweight='bold', color = 'red', fontsize='17', horizontalalignment='center')
    plt.show()```

    posted in Pythonista read more
  • ramvee

    Hope this helps..

    # sets date time picker
    # you can get details of different parameters from strftime.org
    import datetime, ui
    date_picker = ui.DatePicker(bg_color=1)
    date_picker.mode = ui.DATE_PICKER_MODE_DATE_AND_TIME
    date_picker.date = datetime.datetime.strptime('01/03/1958-07:00:PM', '%d/%m/%Y-%I:%M:%p')
    date_picker.present()
    

    posted in Pythonista read more
  • ramvee

    Hi,
    I wrote a small utility for this.. hope you find it useful.

    https://forum.omz-software.com/topic/4328/modules-of-pythonista-displayed-with-help

    posted in Pythonista read more
  • ramvee

    @cvp Totally Agree!!

    posted in Pythonista read more
  • ramvee

    Congratulations @omz .. Well Deserved!
    No Better App Than Pythonista, To Learn Python.. On iOS!

    posted in Pythonista read more
  • ramvee

    @Phuket2
    Very nice example, my friend thank you!
    I will try and learn it!
    Grateful 😁

    posted in Pythonista read more
  • ramvee

    @shtek and @Phuket2 ,
    Thank you for your suggestions,
    i edited the code to suppress the keyboard, added color and tried to use scaleable fonts.
    However i need more learning to incorporate search/filter option.

    ps. @Phuket2 , was shocked to see that your 12.9 iPad Pro has a screen resolution of 2732 X 2048 pixels! Wow! :)

    posted in Pythonista read more
  • ramvee

    Hi,
    I wanted a list of modules importable in Pythonista and display corresponding help() text.
    As i found help() spewing out text to console for each module cumbersome, i wrote this snippet.
    I am sure there must be better ways to doing this. But I am just learning, and
    it works :)
    Also I learned a little bit about stdout, pkgutil, StringIO in this process.
    More Power To Pythonista!

    # View help text for all the importable modules
    # using StringIO
    # Edited based on suggestions by @shtek & @Phuket2 
    # Edited to make use of contextlib.redirect_stdout
    # coding: utf-8
    
    import ui, pkgutil
    from io import StringIO
    from contextlib import redirect_stdout
    
    w, h = ui.get_screen_size()
    fontsize = 15
    if w > 767:
        fontsize = 24
    if w > 1500:
        fontsize = 36
    
    modulelist = []
    for pkg in pkgutil.iter_modules():
        modulelist.append(pkg[1])
    
    
    def load_action(sender):
        ttval = (ttableview1.data_source.items[sender.selected_row])
        # redirecting output using contextlib.redirect_stdout
        help_str = StringIO()
        with redirect_stdout(help_str):
            help(ttval)
        helptext = help_str.getvalue()
        ttextview1.text = helptext
    
    ttextview1 = ui.TextView(name='ttextview1', frame=(w * .3, 0, w * .7, h * .9), flex='WH', text='Click Any Module On Left', border_width=1, border_color=0, font=('<system>', fontsize), bg_color = 'lightyellow', text_color = 'red')
    ttextview1.editable = False
    
    ttableview1 = ui.TableView(name='ttableview1', frame=(0, 0, w * .3, h * .9), flex='HR', border_width=1, border_color=0, row_height=h / 20, seperator_color = 'red', alpha = .8)
    
    list_source = ui.ListDataSource(sorted(modulelist))
    list_source.font = ('Avenir Next Condensed', fontsize)
    list_source.text_color = 'red'
    list_source.highlight_color = 'yellow'
    ttableview1.data_source = ttableview1.delegate = list_source
    ttableview1.data_source.action = load_action
    
    vname = str(len(modulelist)) + ' Modules'
    view = ui.View(name=vname, bg_color = 'yellow', frame=(0, 0, w, h * .9))
    
    view.add_subview(ttableview1)
    view.add_subview(ttextview1)
    view.present(title_bar_color = 'yellow')
    

    posted in Pythonista read more
  • ramvee

    @Phuket2,
    Thank you for the info, will try and understand what this is about!
    Admire you for your helping nature!
    Namaste!

    posted in Pythonista read more
  • ramvee

    Totally Agree With @Phuket2 ..
    In Fact, I Do Not Even Use .pyui Files Anymore 🙏🏽👍🏽🙏🏽

    posted in Pythonista read more
  • ramvee

    Hi @pyfonista,
    I am a beginner myself, but hope this helps.
    Note your my_gui.pyui file should have 3 buttons with their action as, small_tapped, medium_tapped and large_tapped. Also you must have a textfield1 to print the status of which button is pressed.

    import ui
    
    def small_tapped(sender):
        sender.superview['textfield1'].text= 'Small'
        
    def medium_tapped(sender):
        sender.superview['textfield1'].text= 'Medium'
    
    def large_tapped(sender):
        sender.superview['textfield1'].text= 'Large'
        
    def main():
        ui.load_view('my_gui').present('sheet')
    
    main()
    

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!