Page 1 of 1

Getting started with GUI Creation + Online APIS

Posted: Sat Mar 26, 2016 2:19 pm
by SamDoesPi
Is there any good tutorials/YouTube videos that help when creating GUIs in Python (I'm pretty new to Python).
Also, how do I write and read to a .txt file through Python?
Python could grab data from the internet. Is there any APIs for grabbing location (with users permission), Google Calender/iOS Calender, E-mail (for grabbing email through Python to display in project) , Sending camera pictures over bluetooth by having the Pi take it, and python send it to a phone/tablet/other device?, time & date and temprature (I can already do weather)?

Re: Getting started with GUI Creation.

Posted: Sat Mar 26, 2016 2:38 pm
by ghans

Re: Getting started with GUI Creation + Online APIS

Posted: Sat Mar 26, 2016 3:29 pm
by DirkS

Re: Getting started with GUI Creation + Online APIS

Posted: Sat Mar 26, 2016 6:19 pm
by RogerW
You will find lots of different styles for creating a GUI using tkinter. Here is another.

Code: Select all

import tkinter as tk

class WorldFrame(tk.Frame):
	# frame window
	def __init__(self,*args,**kwargs):
		tk.Frame.__init__(self,*args,**kwargs)
		
		label = tk.Label(self,text="Hello world")
		label.grid(column = 0,row = 0)
		
class MainWindow(tk.Tk):
	def __init__(self,*args,**kwargs):
		tk.Tk.__init__(self,*args,**kwargs)
		
		# set size of main window
		self.geometry("200x100")
		
		# place a frame window on top
		# not strctly neccessary but adds flexibility
		frame = WorldFrame(self)
		frame.grid(column = 0,row = 0)

MainWindow().mainloop()
Feel free to come back with questions.