diff --git a/tagscript.py b/tagscript.py index 5b98af9..9ef0489 100644 --- a/tagscript.py +++ b/tagscript.py @@ -93,23 +93,23 @@ def writeImages(i,value,row): global previoustext currentimage = "Images/" + value + ".png" if os.access(currentimage, os.R_OK): - print "Adding " + currentimage + print ("Adding " + currentimage) image = dwg.add(dwg.image(href=("../" + currentimage), insert=(i*imagewidth,textstart))) else: - print "Could not find " + currentimage + print ("Could not find " + currentimage ) #end writeImages #open file with read access -print "Make sure the python script is in the same folder as the file." -myfile = raw_input("Enter file name without the .csv extension (eg. ESP8266/Thing): ") +print ("Make sure the python script is in the same folder as the file.") +myfile = input("Enter file name without the .csv extension (eg. ESP8266/Thing): ") if os.access(myfile +".csv", os.R_OK): file = open(myfile +".csv","r") - print "File opened" + print ("File opened") else: - print "File not found, please try again, there should be a comma deliminated csv file with the data in it. See script for more details" + print ("File not found, please try again, there should be a comma deliminated csv file with the data in it. See script for more details") time.sleep(1) os._exit(0) @@ -144,7 +144,7 @@ def writeImages(i,value,row): if (line[0] == "EOF"): #if we are done dwg.save() break - for i in range(0, len(line)): #go through total number of fields + for i in range(0, len(line)-1): #go through total number of fields if(line[i]!="" and direction=='r'): writeField(i,line[i],row, spot)#call function to add that field to the svg file spot=spot+1 #move 'cursor' one spot to the right diff --git a/tagscript_original-mshorter.py b/tagscript_original-mshorter.py index e4119d8..495a726 100644 --- a/tagscript_original-mshorter.py +++ b/tagscript_original-mshorter.py @@ -126,22 +126,22 @@ def writeImages(i,value,row): global previoustext currentimage = "Images/" + value + ".png" if os.access(currentimage, os.R_OK): - print "Adding " + currentimage + print ("Adding " + currentimage) image = dwg.add(dwg.image(href=("../" + currentimage), insert=(i*imagewidth,textstart))) else: - print "Could not find " + currentimage + print ("Could not find " + currentimage) #end writeImages #open file with read access -myfile = raw_input("Enter file name minus .csv extension ()ex. ESP8266/Thing): ") +myfile = input("Enter file name minus .csv extension ()ex. ESP8266/Thing): ") if os.access(myfile +".csv", os.R_OK): file = open(myfile +".csv","r") - print "File opened" + print ("File opened") else: - print "File not found, please try again, there should be a comma deliminated csv file with the data in it. See script for more details" + print ("File not found, please try again, there should be a comma deliminated csv file with the data in it. See script for more details") time.sleep(10) os._exit(0) @@ -174,7 +174,7 @@ def writeImages(i,value,row): line[0]="" direction = "extras" if (line[0] == "EOF"): #if we are done - print "Done" + print ("Done") dwg.save() break for i in range(0,fields): #go through total number of fields