How do I create a property in a panel to edit particle systems?

I have been trying to create a panel that has a particle system's modifiers, but I do not know how to call the particle system in the panel and I do not know how to get the properties. I tried following the answer on Modifiers: add and set "live" parameters then apply via python.

def draw(self, context):
layout = self.layout

obj = context.object

row = layout.row()
row.label(text = "Basic", icon = 'WORLD_DATA')

row = layout.row()
row.prop(obj.modifiers['Particles'], "count")


It would be something like:

particles = obj.modifiers.get("ParticleSystem 1")
if particles:
row = layout.row()
row.prop(particles.particle_system.settings, "count")


or

particles = obj.particle_systems.get('ParticleSystem')
if particles:
row = layout.row()
row.prop(particles.settings, "count")

• I tried it out but the row won't appear. Dec 30 '15 at 17:46
• then you aren't passing it the right names. In console do obj.modifiers[:] and obj.particle_systems[:] to get the lists.. Dec 30 '15 at 18:10