Hello, World!

Beginners guide to Ask

Initial Project Setup

  • Create a new folder.

  • Create a new Python virtual environment:

    • $ python3 -m venv venv

  • Activate it:

    • $ source venv/bin/activate

  • Install Ask.

    • $ pip install ask-lang

Hello, World! In Ask.

  • Create a file called hello_world.ask.

  • Open it in your favourite text editor or IDE, and set the syntax language to Python.

  • Then write the following in the file.

@get('/hello'):
    respond('Hello, World!')

Run the App

  • Open your terminal in the project folder.

  • Make sure that the virtual environment is activated and Ask is installed ($ ask -v).

  • Run your app with:

    • $ ask hello_world.ask

  • This will start a local server on port 5000.

  • Open a browser and navigate to:

    • http://127.0.0.1:5000/hello

    • You should see the message "Hello, World!".

Last updated