Tuesday, July 19, 2011

Save Function and ... some other things.

Yesterday I was working/finishing up on a proposal for a competition that gives SURF students a chance to use the Hale Telescope at Palomar for a well-designed project. ...Yep.

Today I attempted to learn a little bit about Python's (well...pylab's) savefig(...) function. It lets you save the current figure to a file. However, halfway through I realized that Python has its own save figure code. Simply by pressing 's', you can save the current figure that is selected!

The thing is, the save window will pop up and prompt you for a file name in this case. I'm hoping I can create a function that will allow me to save the figure with the press of a key, and automatically give it a filename without me having to specify one. Maybe something like figure_x, where x is the figure number. Unfortunately, this seems to be difficult to do since I also have to make sure I don't save over any previously saved data.

Results from testing indicated that my code was, unfortunately, not mac compatible (so not much got tested). Apparently it had something to do with end-line characters. I wrote some more lines of code and sent my program back. This time, I'm hoping that it will work.

-How to save things in Python
-Certain compatibility issues

No comments:

Post a Comment