Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import pymssql
  2.  
  3. def connection(contype, spname, spparams='qq'): # which server, whats the sp, what are the parameters needed
  4. #import pdb; pdb.set_trace()
  5. host = 'sunflower.arvixe.com'
  6. username = 'ryantreb'
  7. password = 'ryaniscool'
  8. database='ltalk'
  9. if contype==4:
  10. host = 'parsley.arvixe.com'
  11. username = 'tcgtext'
  12. password = 'tcgiscool!'
  13. database = 'text'
  14.  
  15. conn = pymssql.connect(host, username, password, database)
  16. cursor = conn.cursor(as_dict=True)
  17. try:
  18. cursor.execute(spname)
  19. except:
  20. print(spname)
  21.  
  22.  
  23. rawresults = cursor.fetchall()
  24. conn.commit()
  25. conn.close()
  26.  
  27. return rawresults
  28.  
  29.  
  30. if __name__ == '__main__':
  31. c=connection(4,"exec textadmin.[textsend_TS] @phonenumber='+18134699727', @input ='this is rr 44rra33 test ww1e'")
  32.  
  33. print(c)
  34.  
  35. for item in c:
  36. print(item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement