I am working in current nightly (Version 1.6 beta 2016-01-29), and writing a script. If I want to write a few functions that are linked in the main script, is there a way to import them for use in the main script? Do I have to keep the extra code in my jython shell, should I always include it in the main script even though that mean both a super-huge script and repetition? I would prefer to keep the files separate and linked rather than forcing my colleagues to put support code in their jython shell. Should I create the main script, and put it all in my jython shell and save it as a plugin, that is not very friendly for collaboration.
If I have some code in a file called getFilesNow.py,
Code: Select all
def getGOESRfiles(dir, fileTemplate):
retrun goesRFilesAvailable
and I have a main script, something like...
Code: Select all
import argparse
parser.add_argument('--fileRegEx', action='store', dest='fileString', \
type=str, default=None, \
help='filename regular expression string (overrides sector, band, product selections)')
parser.add_argument('--directory', action='store', dest='directory', \
type=str, default='None', \
help='location of netCDF files')
allFiles=getGOESRfiles(options['directory'], options['fileRegEx'])
print "Continue to display files, etc."