Shorten Python/Maya Window UI code I'd like to know any ways of shortening this UI window for Maya, at the moment, because I couldn't find very detailed documentation and not very skilled with python, I have just built this UI with the knowledge that I have already, I know it's not the best way of doing it (using empty text elements to fill gaps etc)

Can someone provide me with an example on how to shorten this code or structure it properly?

import maya.cmds as cmds
class randomScatter():
    def __init__(self):
        if cmds.window("randSelection", exists=1): cmds.deleteUI("randSelection")
        cmds.window("randSelection", t="Scatter Objects - Shannon Hochkins", w=405, sizeable=0)                
        cmds.rowColumnLayout(nc=3,cal=[(1,"right")], cw=[(1,100),(2,200),(3,105)])
        cmds.text(l="Prefix ")
        cmds.textField("prefix")
        cmds.text(l="")        
        cmds.text(l="Instanced object(s) ")
        cmds.textField("sourceObj", editable=0)      
        cmds.button("sourceButton", l="Select")
        cmds.text(l="Target ")
        cmds.textField("targetObj", editable=0)        
        cmds.button("targetButton", l="Select")
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.text(l='Copy Options ')
        cmds.radioButtonGrp('copyOptions', labelArray2=['Duplicate', 'Instance'], numberOfRadioButtons=2, sl=2)
        cmds.text(l="")
        cmds.text(l="Rotation Options ")
        cmds.radioButtonGrp('orientation', labelArray2=['Follow Normals', 'Keep original'], numberOfRadioButtons=2, sl=1)
        cmds.text(l="")
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.text(l="")
        cmds.checkBox('copyCheck', l='Stick copies to target mesh.')
        cmds.text(l="")
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.text('maxNumber', l="Copies ")      
        cmds.intFieldGrp("totalCopies", nf=1, v1=10, cw1=100)
        cmds.text(l="")
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.separator( height=20, style='in')
        cmds.text(l='')
        cmds.text(l=" From                          To", align='left')             
        cmds.text(l='')
        cmds.text(l="Random Rotation")
        cmds.floatFieldGrp("rotValues", nf=2, v1=0, v2=0, cw2=[100,100])
        cmds.text(l="")   
        cmds.text(l="Random Scale")
        cmds.floatFieldGrp("scaleValues", nf=2, v1=0, v2=0, cw2=[100,100])
        cmds.text(l="")   
        cmds.setParent("..")
        cmds.rowColumnLayout(w=405)        
        cmds.separator( height=20, style='in')
        cmds.text("Progress", height=20)
        cmds.progressBar('buildGridProgBar', maxValue=100, width=250)
        cmds.separator( height=20, style='in')
        cmds.button("excute", l="Scatter Objects",  w=403, al="right")
        cmds.showWindow("randSelection")
randomScatter()
(1) You define random_scatter as a class but then call it like a function, which works but is confusing. With your programme as it currently stands, there is no reason for it to be a class, so better simply to define random_scatter as a function (use def random_scatter(): at the top). 

(2) You can remove repetition and make the code more readable using functions and loops, e.g. write a function

def insert_seperators(number):
    for _ in range(number):
        cmds.separator(height=20, style='in')


then you can replace 

    cmds.separator( height=20, style='in')
    cmds.separator( height=20, style='in')
    cmds.separator( height=20, style='in')


with

    insert_separators(3)


(3) If you have other functions doing similar things with cmds then try to see what they have in common and put that in a single function, which accepts parameters according to what changes.