Skip to content

Instantly share code, notes, and snippets.

@Kanst
Created March 5, 2015 18:56
Show Gist options
  • Save Kanst/bde9ff307d54de986895 to your computer and use it in GitHub Desktop.
Save Kanst/bde9ff307d54de986895 to your computer and use it in GitHub Desktop.
request.py
#!/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