Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymssql
- def connection(contype, spname, spparams='qq'): # which server, whats the sp, what are the parameters needed
- #import pdb; pdb.set_trace()
- host = 'sunflower.arvixe.com'
- username = 'ryantreb'
- password = 'ryaniscool'
- database='ltalk'
- if contype==4:
- host = 'parsley.arvixe.com'
- username = 'tcgtext'
- password = 'tcgiscool!'
- database = 'text'
- conn = pymssql.connect(host, username, password, database)
- cursor = conn.cursor(as_dict=True)
- try:
- cursor.execute(spname)
- except:
- print(spname)
- rawresults = cursor.fetchall()
- conn.commit()
- conn.close()
- return rawresults
- if __name__ == '__main__':
- c=connection(4,"exec textadmin.[textsend_TS] @phonenumber='+18134699727', @input ='this is rr 44rra33 test ww1e'")
- print(c)
- for item in c:
- print(item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement