Hello,
I am unable to use simple CSV python reader like the Rhino sample…:
import csv
import rhinoscriptsyntax as rs
def CSVbuilding():
#prompt the user for a file to import
filter = "CSV file (*.csv)|*.csv|*.txt|All Files (*.*)|*.*||"
filename = rs.OpenFileName("Open Point File", filter)
if not filename: return
with open(filename) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['Use'], row['Square Footage'])
# print(row)
##########################################################################
# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
if( __name__ == "__main__" ):
CSVbuilding()
It opens the window, let me pick a csv file but I have an error on MAC only:
Message: Use
Traceback:
line 14, in CSVbuilding, “/Users/Antoine/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/IMPORT CSV.py”
line 22, in , “/Users/Antoine/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/IMPORT CSV.py”
Any helps on why it do not works on Mac?
Of course my CSV file has exactly the Use and Square Footage column and datas in a row
Thank a lot