Created
March 5, 2015 18:56
-
-
Save Kanst/bde9ff307d54de986895 to your computer and use it in GitHub Desktop.
request.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import psycopg2 | |
def main(): | |
conn = psycopg2.connect(database='assa', user='assa', password='assa', host='192.168.56.120', port='5432') | |
conn.autocommit = True | |
cur = conn.cursor() | |
cur.execute("select 1") | |
result = cur.fetchone() | |
print result | |
cur.close() | |
conn.close() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment