+ Reply to Thread
Results 1 to 4 of 4

Thread: Upgrading Rhino's version of Ironpython

  1. #1

    Upgrading Rhino's version of Ironpython

    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

  2. #2
    .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 rows
      f = open('output/my.csv', 'w') # open a writable file object
      for row in data: # if `row` is a list.
          row_string = ','.join(row) # all the values will be joined with commas
          f.write(row_string) # add the row of values to your file
          f.write('\n') # add a newline symbol to start a new row
      f.close() # close when you're done
       

  3. #3
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,472
    Blog Entries
    19
    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

  4. #4
    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

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts