SamDoesPi
Posts: 58
Joined: Tue Feb 16, 2016 6:36 pm

Getting started with GUI Creation + Online APIS

Sat Mar 26, 2016 2:19 pm

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)?

ghans
Posts: 7876
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Getting started with GUI Creation.

Sat Mar 26, 2016 2:38 pm

• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org


User avatar
RogerW
Posts: 285
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: Getting started with GUI Creation + Online APIS

Sat Mar 26, 2016 6:19 pm

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.

Return to “Python”