Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. #!/usr/bin/python
  2. import psycopg2;
  3.  
  4. connection = psycopg2.connect('datbase=virtual_mail user=foo password=bar host=example.com');
  5.  
  6.  
  7. cursor     = connection.cursor();
  8.  
  9. sql = 'SELECT id,legacy_username from virtual_mail; ';
  10. cursor.execute( sql );
  11.  
  12. rows = cursor.fetchone();
  13. print rows[0];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement