• danxx26

    this module works from what I can tell (have not tested all methods). It depends on beautifulsoup and Pytz. I looked through the
    Code and it’s just Python. To install this get “Stash” then inside of Stash type:

    pip install yahoofinancials
    

    this will install the module and you will be able to use it by importing into your program.

    posted in Pythonista read more
  • danxx26

    Scapy requires npcap which I believe does not run on iOS due to Apple restrictions. If you want do packet analysis the only way that I know is covered here in this article:
    link text

    posted in Pythonista read more
  • danxx26

    Here is my Chuck Norris api code:

    #!/usr/bin/env python
    """downloads a random Chuck Norris joke or fact using the api"""
    
    import requests
    import json
    import ui
    import console
    
    
    def main():
        display_banner()
        print()
        console.show_activity()
        data = get_joke()
        text = parse_json(data)
        print(display_joke(text))
        # button_tapped(sender)
        console.hide_activity()
    
    
    def display_banner():
        print('-' * 40)
        print('|         Chuck Norris Jokes           |')
        print('-' * 40)
    
    
    def get_joke():
        response = requests.get('https://api.chucknorris.io/jokes/random')
        if response.status_code == 200:
            print(response.status_code)
            # rest = response.content
        else:
            print("error unable to connect to api\n")
            print(response.status_code)
    
        rest = response.content
        return rest
    
    
    def parse_json(data):
        text = json.loads(data)
        text = (text['value'])
        # print(text)
        return text
    
    
    def display_joke(text):
        formatted = str(text).strip()
        # print(type(formatted))
        return formatted
    
    
    # def button_tapped(sender):
    # chuck = button_tapped(sender)
    #    sender.title = chuck
    #    view = ui.load_view('chuck')
    #    view.present('full_screen')
    #    return # #view.present('full_screen')
    
    if __name__ == '__main__':
        main()
    

    posted in General Discussion read more
Internal error.

Oops! Looks like something went wrong!