You cannot tell by just looking at them. There are 2 definitive methods for determining the sex of a Ball Python:
1) Probing - This is the preferred method, especially if you have larger, adult snakes. A dull, lubricated probe is inserted (by someone that knows what they are doing), into the vent area of the snake. Males have a cavity that protects their sexual organs and the probe is able to insert into this open space further than it would insert into a female. This deeper probe depth, or lack there of, enables you to determine the sex of the snake.
2) Popping - Gentle pressure is applied from the tip of the tail towards the vent to expose the males sexual organs, or lack ther of. This method takes, (for me), more practice and is more difficult to use with adult snakes because they have more muscle control in this area.