Hi Everyone,
Is it possible to upgrade the version of Ironpython Rhino uses? I am trying to use the CSV module which was implemented in 2.7.1. If I am unable to upgrade does anyone know a workaround to write a .CSV file in Ironpython?
Thanks!
Andrew
Hi Everyone,
Is it possible to upgrade the version of Ironpython Rhino uses? I am trying to use the CSV module which was implemented in 2.7.1. If I am unable to upgrade does anyone know a workaround to write a .CSV file in Ironpython?
Thanks!
Andrew
.csv files are generally really easy to write.
Here's an example:
Python Code:
# we'll assume you have a variable called data organized into rowsf = open('output/my.csv', 'w') # open a writable file objectfor row in data: # if `row` is a list.row_string = ','.join(row) # all the values will be joined with commasf.write(row_string) # add the row of values to your filef.write('\n') # add a newline symbol to start a new rowf.close() # close when you're done
Hi Andrew,
We do plan on eventually updating the IronPython build to the latest in V5. It just hasn't been as easy as I originally thought it would be because of installer issues.
Thanks,
-Steve
Thank you for that piece of code Ben; that worked perfectly!
Thanks for the reply Steve. Best of luck with the updating process! I am looking forward to what you have in store for Ironpython.
-Andrew