--- Thermodyn2XML_vanilla_7_11_05.py 2008-08-06 03:02:32.345055927 +0200 +++ Thermodyn2XML_vanilla_7_11_06.py 2008-08-06 03:00:08.014058812 +0200 @@ -184,31 +184,30 @@ # (?P.{17}.?.?)(?PTT?|RUS|IU|P|G|J|B|L|CODA|R|S|HF|D|A|E|F)\s*(?P(?:/)?(?:\d\d|\d)?(?:/?)(?:\d\d))\s*(?:(\s*WARNING!\s*0?\.?)|(?P[A-Z]{1,2})\s*(?P-?\d+)\.?(?P[A-Z]{0,2})\s*(?P-?\d+)\.?(?P[A-Z]{0,2})\s*(?P-?\d+)\.?(?P[A-Z]{0,2})\s*(?P-?\d+)\.?)(?PG|L|S|C)\s*(?P\d*\.\d*)\s*(?P\d*\.\d*)\s*(?PA|B|C|D|E|F)?\s*(?P\d*\.\d*)\s* ########################################################################################################### # Data preparation: -############### USE THESE COMMANDS IN UNIX SYSTEM ############################################ -#if len(sys.argv) != 2: -# print "Usage: ./Thermodyn2XML.py filename" -# sys.exit() -#data = open(sys.argv[1], "r").read() -# data = open(r'1.txt', "r").read() <-It is commented in the original code. -#data += '\n0-0-0' # this was added due to the way we recognise species -######################################################################################### -# Data preparation: -############### USE THESE COMMANDS IN WINDOWS SYSTEM ####################################### -# Open Input File -try: - data = open('BURCAT_THR.txt', "r+").read() - data += '\n0-0-0 ' # this was added due to the way we recognise species -except IOError: - print >> sys.stderr, "File could not be opened" - sys.exit( 1 ) -# Open XML Output File -#try: -# file = open('BURCAT_THR.xml', "w") - #data += '\n0-0-0 ' # this was added due to the way we recognise species -#except IOError: -# print >> sys.stderr, "File could not be opened" -# sys.exit( 1 ) -############################################################################################## +if (sys.platform[:3] == "win"): + ############### USE THESE COMMANDS IN WINDOWS SYSTEM ####################################### + # Open Input File + try: + data = open('BURCAT_THR.txt', "r+").read() + data += '\n0-0-0 ' # this was added due to the way we recognise species + except IOError: + print >> sys.stderr, "File could not be opened" + sys.exit( 1 ) + # Open XML Output File + #try: + # file = open('BURCAT_THR.xml', "w") + #data += '\n0-0-0 ' # this was added due to the way we recognise species + #except IOError: + # print >> sys.stderr, "File could not be opened" + # sys.exit( 1 ) +else: + ############### USE THESE COMMANDS IN UNIX SYSTEM ############################################ + if len(sys.argv) != 2: + print "Usage: ./Thermodyn2XML.py filename" + sys.exit() + data = open(sys.argv[1], "r").read() + # data = open(r'1.txt', "r").read() <-It is commented in the original code. + data += '\n0-0-0' # this was added due to the way we recognise species # Open XML Output File