Created
December 1, 2012 02:12
-
-
Save alijnclarke/4180190 to your computer and use it in GitHub Desktop.
COMP2740 - Filename module for quakes.py. Generates dynamic filename based on cmd arguments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filename(type): | |
''' Function to generate the correct name for the two files outputted by quakes.py | |
this function takes the parameter type as the identifier for the output required ''' | |
global name | |
if type == "write": | |
name = 'quakes-' + str(sys.argv[1] + '-' + str(sys.argv[2]) + '.loc') #Concatinates string | |
elif type == "html": | |
name = 'quakes-' + str(sys.argv[1] + '-' + str(sys.argv[2]) + '.html') | |
return name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment