Closed npr99 closed 3 months ago
found issue where code sometimes uses the community label and other times uses county
def setup_directory():
output_sourcedata = os.path.join('Outputdata', '00_SourceData')
output_directory = os.path.join(output_sourcedata, 'nces_ed_gov')
unzipped_output_directory = os.path.join(output_directory, 'unzipped')
# Create output directory if it does not exist
def create_directory(path):
if not os.path.exists(path):
print(f"Making new directory to save output: {path}")
os.makedirs(path)
else:
print(f"Directory {path} already exists.")
create_directory(output_sourcedata)
create_directory(output_directory)
create_directory(unzipped_output_directory)
return output_directory, unzipped_output_directory
replace def setup_nsi_directory():
output_folder = 'Outputdata'
output_sourcedata = 'Outputdata\\00_SourceData'
output_directory = 'Outputdata\\00_SourceData\\nsi_sec_usace_army_mil'
# Make directory to save output
if not os.path.exists(output_folder):
print("Making new directory to save output: ",
output_folder)
os.mkdir(output_folder)
if not os.path.exists(output_sourcedata):
print("Making new directory to save output: ",
output_sourcedata)
os.mkdir(output_sourcedata)
if not os.path.exists(output_directory):
print("Making new directory to save output: ",
output_directory)
os.mkdir(output_directory)
else:
print("Directory",output_directory,"Already exists.")
return output_directory
notice I had Outputdata not in camelcase OutputData
I think I just realized - the issue is that codespace is Linux and my code is designed to run on Windows
code seems to be creating multiple outputdata folders