450 likes | 560 Views
This extensive Python tutorial, presented by Kurt Schwehr on October 31, 2006, serves as a valuable resource for coastal and ocean mapping professionals at the NOAA/UNH Joint Hydrographic Center. It covers essential Python topics, including file handling, modules, string operations, and function documentation. Key features include integrating Gnuplot for data visualization and comprehensive guidance on using Python’s math and decimal modules. This tutorial is designed to enhance your Python programming skills for effective data handling in ocean mapping applications.
E N D
31-Oct-2006 A Python Tutorial Title Center for Coastal and Ocean Mapping NOAA/UNH Joint Hydrographic Center Kurt Schwehr 31 Oct 2006
Reading a file Adding a comma prevents the extra new line
Writing a python file (aka module) • env finds python in your path • chmod +x dump.py • ./dump.py
Handling programs in a better way • __name__ is set to main if the file is being executed
Use this function from outside the file • Whoops - no documentation!
Epydoc is Kurt’s favorite way to document python code • Epydoc imports your file and creates html documentation
Here is the initial edydoc page • Nice, but could be better • Use markups in the doc string to tell epydoc more