# basic version--runs from command line
# needs Python 2.x
# TO-DO: add error checking facility

import os   # needed for opening/compiling file
import time # needed for delay
def getPath():
    """Ask the user for the file path and return it as string."""
    path = raw_input("Enter path of lilypond file (including file but without extension), or enter nothing to cancel: ")
    return path

answer = ""
path = getPath()

while answer.lower() != "e":
    answer = raw_input("Enter Y or C to compile, E to exit, or P to change file path: ")
    if answer.lower() == "y" or answer.lower() == "c":
        os.startfile(path + ".ly")
        print "Opening log file in 10 seconds..."
        time.sleep(10)
        print "Log file: =========================="
        logfile = open(path + ".log", "r")
        print logfile.read()
        print "End of log file: ==================="
        print "===================================="
    elif answer.lower() == "p":
        path = getPath()
    

@@ -1,101 +1,4 @@
-# basic version--runs from command line%0A# needs Python 2.x%0A# TO-DO: add error checking facility%0A%0A
 impo
@@ -84,16 +84,34 @@
 getPath(
+allowCancel = True
 ):%0A    %22
@@ -129,19 +129,24 @@
 ser for 
-the
+lilypond
  file pa
@@ -176,162 +176,605 @@
 ing.
-%22%22%22%0A    path = raw_input(%22Enter path of lilypond file (including file but without extension), or enter nothing to cancel: %22)%0A    return path%0A%0Aanswer = %22%22%0A
+%0A%0ATakes one boolean argument as to whether message should say cancelling is allowed or not. Defaults to true, however this may not be suitable for where the path is needed for initialisation.%22%22%22%0A    if allowCancel == True:%0A        question = %22Enter path of lilypond file (including file but without extension), or enter nothing to cancel: %22%0A    else:%0A        question = %22Enter path of lilypond file (including file but without extension): %22%0A    path = raw_input(question)%0A    return path%0A%0Alogwait = 5 # how long the program waits before opening the log%0Aanswer = %22%22%0Apath = %22%22%0Awhile path == %22%22:%0A    
 path
@@ -784,16 +784,21 @@
 getPath(
+False
 )%0A%0Awhile
@@ -1035,18 +1035,36 @@
 file in 
-10
+%22 + str(logwait) + %22
  seconds
@@ -1091,10 +1091,15 @@
 eep(
-10
+logwait
 )%0A  
@@ -1388,9 +1388,4 @@
 h()%0A
-    %0A

store wait time in variable, stop user from entering nothing for the path first time, and allow file path prompt to show/hide cancel message