From 25bc367ee937d99ce21ca5fee2f32ee3e0a22b11 Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Sat, 13 Oct 2018 13:31:26 +0200 Subject: [PATCH] Script execution --- script/users/Granas/automise.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/script/users/Granas/automise.py b/script/users/Granas/automise.py index 1aaacb84..fba71b33 100644 --- a/script/users/Granas/automise.py +++ b/script/users/Granas/automise.py @@ -1,12 +1,16 @@ +""" +2018-10-13 +author: christoph Seitz -measurement = "" +""" -path = "/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/set_measure.txt" + +command_path_tmp = "/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/set_measure.txt" for i in range(60): time.sleep(4) - if os.path.exits(path): - cont = open(path).read() + if os.path.exits(command_path_tmp): + cont = open(command_path_tmp).read() #reading command from file if "manipulator spectrum O1s" in cont: select_edge_tmp = "O1s " execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan.py") @@ -22,3 +26,14 @@ for i in range(60): if "exit_loop": break +#printing the end to file +for i in range(3): + try: + print("loop is closed now") + open(path,'w').write("loop is closed now") + break + except: + print("ending loop failed") + print("trying again") + + \ No newline at end of file