from time import sleep
import subprocess
import os, sys

def Simulate_Strokes(myfile):
        '''Run Notebook.exe with the file provided'''
        
        file_path = os.path.join ("C:", myfile)
        executable_name = "C:\\Windows\Notepad.exe"
        cmd = '""%s" "%s"" 2>&1' % (executable_name, file_path)
        print "Running:", cmd
        try:         
            os.system (cmd)
            print 'INFO : Notebook execution Succeeded'
            return 0
        except Exception, e:
            print 'FAIL : Notebook execution Failed'
            print "Caught exception: " % str(e)
            raise   

if __name__ == '__main__':
	from time import sleep
	
	Simulate_Strokes("test.txt")
	
