Advertisement
Guest User

local files in kivy

a guest
Jan 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. from kivy.app import App
  2. from kivy.lang import Builder
  3. from kivy.uix.button import Button
  4. from kivy.properties import ObjectProperty
  5. from kivy.uix.gridlayout import GridLayout
  6.  
  7. import fiona
  8. import sqlite3
  9.  
  10.  
  11.  
  12.  
  13. class AddButton(Button):
  14.     pass
  15.  
  16.  
  17. class SubtractButton(Button):
  18.     pass
  19.  
  20.  
  21. class Container(GridLayout):
  22.     display = ObjectProperty()
  23.  
  24.     def add_one(self):
  25.            
  26.     value = int(self.display.text)
  27.         conn = sqlite3.connect('./test.sqlite')
  28.     cur = conn.cursor()
  29.     cur.execute("select 1 as a")
  30.     self.display.text=str(cur.fetchone()["a"])
  31.  
  32.     def subtract_one(self):
  33.         value = int(self.display.text)
  34.     peo=fiona.open('./etiquetas_geo.shp')
  35.    
  36.         self.display.text = str(value-1)
  37.  
  38.  
  39. class MainApp(App):
  40.     def build(self):
  41.     self.title = 'Probatina'
  42.         return Container()
  43.  
  44.  
  45. if __name__ == "__main__":
  46.     app = MainApp()
  47.     app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement