AnsweredAssumed Answered

Python - Save output files with unique names

Question asked by moshell4413 on Jun 29, 2018
Latest reply on Jun 29, 2018 by bixb0012

I'm a GIS Analyst who is VERY new to Python. I have successfully run the script below. However, when I want to run it again with a different input file it gives me the 000725 error...output file already exists. How do I automatically create a unique output filename every time I run this script?


>>> #ADD NETCDF FILE POINTS TO THE MAP ... arcpy.MakeNetCDFFeatureLayer_md(in_netCDF_file="Z:/ENGINEERING/Stormwater/Stormwater Files/Rainfall/NWS NetCDF Files/nws_precip_1day_20180625_netcdf/", variable="observation", x_variable="x", y_variable="y", out_feature_layer="observation_Layer", row_dimension="x;y", z_variable="", m_variable="", dimension_values="", value_selection_method="BY_VALUE") ... Runtime error Traceback (most recent call last): File "<string>", line 2, in <module> File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\", line 125, in MakeNetCDFFeatureLayer raise e ExecuteError: ERROR 000725: Output Feature Layer: Dataset observation_Layer already exists. >>>