WLST Script to deploy jar file on Weblogic Server

print 'deploying jar...'

connect('weblogic','weblogic123','t3://localhost:7001')
try:

    undeploy('app')
    print 'Redeploying'

except Exception:
    print 'Deploy'

status = deploy(appName='app', path='app.jar',targets='AdminServer,', libraryModule='true')

print status