If you want to use numbers in the file names, you can check what files with similar names already exist in that directory, take the largest one, and increment it by one. Then pass this new number as a variable in the string for the filename.
For example:
import glob
import re
# get the numeric suffixes of the appropriate files
file_suffixes = []
for file in glob.glob("./Spline_shp*"):
regex_match = re.match(".*Spline_shp(\d+)", file)
if regex_match:
file_suffix = regex_match.groups()[0]
file_suffix_int = int(file_suffix)
file_suffixes.append(file_suffix_int)
new_suffix = max(file_suffixes) + 1 # get max and increment by one
new_file = f"C:/Users/moshell/Documents/ArcGIS/Default.gdb/Spline_shp{new_suffix}" # format new file name
arcpy.gp.Spline_sa(
"Observation_RegionalClip_Clip",
"observatio",
new_file,
"514.404",
"REGULARIZED",
"0.1",
"12",
)
Alternatively, if you are just interested in creating unique filenames so that nothing gets overwritten, you can append a timestamp to the end of the filename. So you would have files with names like "Spline_shp-1551375142," for example:
import time
timestamp = str(time.time())
filename = "C:/Users/moshell/Documents/ArcGIS/Default.gdb/Spline_shp-" + timestamp
arcpy.gp.Spline_sa(
"Observation_RegionalClip_Clip",
"observatio",
filename,
"514.404",
"REGULARIZED",
"0.1",
"12",
)