The normally quoted 'inches' measure (eg 27 inch widescreen) is a measure of the length of the diagonal. So you can't work out the ratio from that on its own.
For flat panels, you could take the width (in pixels) and divide it by the height (in pixels). But this calulation assumes that pixels are always exactly square. And they aren't always.
So the only way it can be done is:
With a ruler/tape measure - measure the exact height and the exact width of the visible screen.
Aspect ratio is width divided by height (which will give you an answer of
1.33 for 4x3 screens (because 4 divided by 3 is also 1.33)
1.78 for 16x9 screens
1.6 for a 16x10 screen