• myko

    How can I debug my webapp in Pythonista? In the python learning book they use this code:

    app.run(debug=True)
    

    It doesn't function in Pythonista and I get these messages:

    from flask import Flask, render_template
    
        
    app = Flask(__name__)
    
    @app.route('/') 
    def hello() -> str:
        return 'Hello world from Flask!'
    
    @app.route('/search4', methods=['POST']) 
    def do_search() -> str:
        return str(search4letters('life, the universe and everything','eiru,!'))
        
    @app.route('/entry') 
    def entry_page() -> 'html':
        return render_template('entry.html', the_title='Welcome to search for letters on the web!')
    
    app.run(debug=True)
    
    

    posted in Pythonista read more
  • myko

    Thank you! It works.

    posted in Pythonista read more
  • myko

    @cvp Thank you! Where should i enter the name of my file? The name is "base.html". I tried this option with a console, but it didnt function.

    file_path = urlparse.urljoin('file://', os.path.abspath('base.html'))
    w = ui.WebView()
    w.load_url(file_path)

    Error message:

    File "<string>", line 1
    file_path = urlparse.urljoin('file://', os.path.abspath('base.html'))

    SyntaxError: multiple statements found while compiling a single statement

    posted in Pythonista read more
  • myko

    I am a complete beginner. I try to do some examples from a python learning book. One example explains how to build a webapp. The webbapp should search for letters in words, which I should be able to fill in the html form (this example also uses Flask). I wonder if i can do it with pythonista. I created in pythonista a script, html pages and css files. The first problem is that i don't know how to open my html files from pythonista in a webbrowser. I have found out how to open an url or quicklook. Is it any way to open html files in a browser? Thank you!

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!