Python and particle system
Python console code.

Add a particle system to the context object, Note the reference returned ps if the system names this system "part.001" it will be ps.name

&gt;&gt;&gt; ob = C.object
&gt;&gt;&gt; ps = ob.modifiers.new("part", 'PARTICLE_SYSTEM')
&gt;&gt;&gt; ps.name
'part'


another

&gt;&gt;&gt; ps = ob.modifiers.new("part", 'PARTICLE_SYSTEM')
&gt;&gt;&gt; ps.name
'part.001'


The newly created particle system in the objects particle system collection

&gt;&gt;&gt; psys = ob.particle_systems[ps.name]


psys.settings is a pointer to the particle settings stored in bpy.data.particles referred to by this particle system.  Notice it has the name "part.001" but we haven't used the name to find it at all, only a reference and pointer

&gt;&gt;&gt; psys.settings
bpy.data.particles['part.001']


Use this pointer to set some properties (as in question code)

&gt;&gt;&gt; psys.settings.count = 10000
&gt;&gt;&gt; psys.settings.type = 'HAIR'


Can use this to set to a predefined set of settings, in this example a previously defined group of settings named "Wooble"

&gt;&gt;&gt; psys.settings = D.particles['Wooble']
&gt;&gt;&gt;