Q:

how can I implement a program to interact with me using python?

I want write a very simple program with python:
while True:
    # 1. input = get sys.std

    if input == 'y':
        print "yes"
    elif input == 'n':
        print "no"
    else input == 'q':
        # 2. quit

how can I implement step 1 and step 2?

A:

If you need user input you have two ways to do it:
# Get shell command line arguments
import sys
print( sys.argv )

# If you want user input
user_input = raw_input('Please enter your value: ')

If you want to exit currently executing script you can use sys.exit(). Make sure you call the exit from the main script, unintercepted by any try... except.
I highly recommend you read Python tutorials

