How to fill up a PointCloud Message with data in Python?

I want to set up a PointCloud Message in my python main.
I already read the docs: http://docs.ros.org/api/sensor_msgs/h...
But I don't catch it. This is what I got so far (spread over the different classes):

I don't understand how to fill up the PointCloud with data. I googled quite a bit, but the most, if not all, examples are for C++. Can somebody enlighten me, please?

edit according to marguedas comment/answer:

I think i got the basic idea, the problem is that the program shuts down without any error which makes debugging quite hard. First of all, let me answer your questions. The points are generated in a Kivy based gui, so I basically got three arrays (one for x, one for y and one for the time - so I am using the z coordinate to transmit information about the time). The information i collect in the x and y vectors are speed values for a stepper motor. To conlude: for each point I have two speed values and one time value. I tryed to use the PointCloud, cause I don't like the way to publish matrices in ROS (at least so far...). The following shows the code i got so far (only the parts important for this specific problem):

Your current error is due to the fact that you need to resize the channel data structure instead of assigning it a scalar value.
I've never tried to use pointcloud for this kind of purpose. I'm not sure that is the best structure for your application. To my understanding you just need a way to convey tuples of size3. Is that right?

If I was you I would not be using a PointCloud structure but rather something like a Vector3 Array.
You create a custom message which is an array of Vector3
You can check here for custom message generation
you do the following

Just one more question! I made it pretty far with your excellent explanation! self.vectordaten_tabelle.append(vec3) in that line the programm crushes. My custom message looks like: geometry_msgs/Vector3[] Vector3DArray. Everything else is equivalent to your code above. Any ideas?

my bad, you have to specify the structure you want to add your element to, if your message is geometry_msgs/Vector3[] Vector3DArray
you need to add element to the Vector3DArray array, so:self.vectordaten_tabelle.Vector3DArray.append(vec3)

thanks again! you saved me a ton of research! the array gets appended now, but every entry gets overridden with the newest vec3. So my message is an array of vector3() (with anzahl_punkte entrys), but every entry is e.g. x = 0, y = 0, z = 0.5, cause those are the values of the last vec3() i appended

Comments

Your solution really help a lot for a beginner like me!
Thank you so much!
May I know which reference can i refer to to change pointcloud2 colour based on sensor value ?
my application is to do something like heatmap. Do you think it is suitable to use pointcloud2 for this purpose ?