Python Pig Latin Translator This is only my second Python script, so let me have it!  If anything seems off in style or implementation, please nit pick away.  I want to learn.  I know it could've been done in less lines of code without making separate functions and whatnot, but I wanted to approach it like I would an actual project.

#!/bin/usr/python
from sys import exit

def print_help():
    print("")
    print("--------------------------------")
    print(" Command   |  Description")
    print("--------------------------------")
    print(" -h        |  Print help list")
    print(" -x        |  Exit program")
    print("--------------------------------")
    print("")

def is_valid_word(word):
    return word and word.isalpha()

def is_valid_string(string):
    for word in string.split(" "):
        if not is_valid_word(word):
            return False
    return True

def get_pig_latin(string):
    vowels = "aeiou"
    built = ""
    for word in string.split(" "):
        if len(word) &lt; 2 or word[0] in vowels:
            built += word + "tay"
        else:
            temp = word
            while temp[0] not in (vowels + "y"):
                temp = temp[1:] + temp[0]
            built += temp + "ay"
        built += " "
    built = built[0].upper() + built[1:]
    return built

def print_title():
    print("")
    print("--------------------------------")
    print("----- PIG LATIN TRANSLATOR -----")
    print("--------------------------------")
    print("Type -h for help")
    print("")

def run():
    commands = { "-h" : print_help, 
                 "-x" : exit }
    print_title()
    while True:
        input = raw_input(":: ").strip().lower()
        if input in commands:
            commands[input]()
        elif is_valid_string(input):
            print("-&gt; " + get_pig_latin(input) + "\n")
        else:
            print("   Unrecognized word or command.\n")

if __name__ == "__main__":
    run()
Not essential but I would find it neater to make a function that translates a single word, then join those together. You should also deal with the case of a word containing no vowels or 'y', which currently gets your programme stuck in an infinite loop.

def get_pig_latin(string):
    return ' '.join(map(translate_word, string.split(' '))).upper()

def translate_word(word):
    vowels = "aeiou"
    if len(word) &lt; 2 or word[0] in vowels:
        return word + 'tay'
    elif contains_any(word, vowels + 'y'):
        while word[0] not in (vowels + 'y'):
            word = word[1:] + word[0]
        return word + 'ay'
    else:
        return '???'


Then add docstrings to your functions.

EDIT: It might be better to use a for loop instead...

def translate_word(word):
    if len(word) &lt; 2 or word[0] in 'aeiou':
        return word + 'tay'
    for i, ch in enumerate(word):
        if ch in 'aeiouy':
            return word[i:] + word[:i] + 'ay'
    return '???'


You could also consider building the string validation into your translation function with a user-defined exception:

class TranslationError(Exception):
    def __init__(self, value):
        self.value = value

def translate(word):
    if word.isalpha():
        if len(word) &lt; 2 or word[0] in 'aeiou':
            return word + 'tay'
        for i, ch in enumerate(word):
            if ch in 'aeiouy':
                return word[i:] + word[:i] + 'ay'
    # if there is no aeiouy or word is not alphabetic, raise an error
    raise TranslationError(word)    

def run():
    commands = { "-h" : print_help, 
                 "-x" : exit }
    print_title()
    while True:
        inp = raw_input(":: ").strip().lower()
        if inp in commands:
            commands[inp]()
        else:
            try:
                translation = ' '.join(map(translate, inp.split(' '))).upper()
                print("-&gt; " + translation + "\n")
            except TranslationError as e:
                print("   Unable to translate:" + e.value + ".\n")