I found this code sample (originally from the Blender wiki) to be very helpful in understanding file browser usage. Specifically, look at the "execute" method of the ScanFileOperator class, which passes self.filepath (the chosen file) to another function (scanFile):
#
# Opens a file select dialog and starts scanning the selected file.
#
class ScanFileOperator(bpy.types.Operator):
bl_idname = "error.scan_file"
bl_label = "Scan file for return"
filepath = bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
scanFile(self.filepath)
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
StringProperty(subtype='FILE_PATH')
sitting in a panel? $\endgroup$