Advertisement
Guest User

Untitled

a guest
May 27th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. import psycopg2
  2.  
  3. con = psycopg2.connect("dbname='admininfo' user='postgres' password='pT_653#gL@!1' host='54.202.248.116'")
  4. cur = con.cursor()
  5.  
  6. cur.execute("SELECT rating, _id from dingi_pois WHERE source = 'GooglePoi' AND (type LIKE 'restaurant%' OR type LIKE 'mosque%'\
  7. OR type LIKE 'school%' OR type LIKE 'point_of_interest%' OR type LIKE 'store%' OR type LIKE 'clothing_store%'\
  8. OR type LIKE 'shopping_mall%' OR type LIKE 'pharmacy%' OR type LIKE 'home_goods_store%' OR type LIKE 'electronics_store%'\
  9. OR type LIKE 'premise%' OR type LIKE 'food%' OR type LIKE 'hindu_temple%' OR type LIKE 'cafe%'\
  10. OR type LIKE 'furniture_store%' OR type LIKE 'grocery_or_supermarket%' OR type LIKE 'lodging%'\
  11. OR type LIKE 'hair_care%' OR type LIKE 'hardware_store%' OR type LIKE 'general_contractor%' OR type LIKE 'supermarket%'\
  12. OR type LIKE 'jewelry_store%' OR type LIKE 'beauty_salon%' OR type LIKE 'shoe_store%' OR type LIKE 'place_of_worship%' OR type LIKE 'bakery%'\
  13. OR type LIKE 'doctor%' OR type LIKE 'dentist%' OR type LIKE 'bicycle_store%' OR type LIKE 'electrician%' OR type LIKE 'physiotherapist%');")
  14.  
  15. rows = cur.fetchall()
  16. file = open('typeReduction.txt', 'w')
  17. for row in rows:
  18. if row[0] is None or row[0] < 3:
  19. file.write(str(row[1]) + '\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement