I am trying to run a cloth simulation in blender using python scripting and despite setting the frame_end of the scene to the desired number of frames (C.scene.frame_end = total_frames), the cloth stops at 250 frames.
I eventually found that that I need to set the frame_end for the cloth as well, and I tested it and it works, but I don't know how to do the same operation via scripting.
Here is a screenshot of the particular setting I am trying to change.

When I change the setting via the user interface, the following appears in the info view mode:
bpy.context.object.frame_end = 285
However, when I try to do the exact same thing via the python console, blender will give me the following error:
>>> bpy.context.object.frame_end = 285
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: 'Object' object has no attribute 'frame_end'
>>> bpy.context.object
bpy.data.objects['shirt']
When I hover over the property, the "command" that pops up is also incomplete:
bpy.data.objects['shirt'] ... frame_end
How do I change this property via scripting?

context.object.modifiers['Cloth'].point_cache.frame_end(where the cloth modifiers name is "Cloth" and the object has context) – batFINGER May 15 '18 at 13:09