Skip to content

Python3 is supported #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tagscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tagscript_original-mshorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down