Paul Sutton

codeclub

Ruby

Another useful programming language is Ruby, if you liked the Sonic Pi activities, then you may find, that Ruby is a nice step on from this.

If you have a repl.it account then you can start programming in browser, which is great, as it saves having to install the software locally, which isn't always possible or allowed if you're in school for example. You can also ask for help from the forums or collaborate with friends.

In terms of more semi formal learning, Codecademy has a course, which I found pretty good.

A few other resources are listed below:-

There is, or was, Kids Ruby which was a nice programming application for kids. I am not sure on the current status. I have, asked @kidsruby on Twitter to try and find out.

In the mean time, a search on Duckduckgo, should give you lots of useful information.

#codeclub,#programming,#ruby

Raspberry Pi – Blender

Code Club also offer Blender activities

We have Blender installed at Paignton Library. However as this is a virtual code club, please make sure your home computer meets the minimum specification for installing running Blender.

Further links

Blender Projects

Feel free to share projects on services such as Notabug, this uses git.

Well done for completing all the Code Club activities. I will keep posting more content over the next few weeks. Either new topics or to build on existing topics.

On a related note here are the results of the coolest projects contest.

#codeclub,#activities,#blender,#paignton,#library,#virtual

I can be contacted on Mastodon here. I can also be contacted on twitter at @zleap2018

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

Free Code Camp progress 8/6/2020

Responsive Web Design Principles component of Responsive Web Design course with Free Code Camp is now complete.

accessibility

Now moving on to CSS-Flexbox.

#freecodecamp,#applied,#accessibility,#learning,#skills, #responsive,#web,#design,#codeclub

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

I can be contacted on Mastodon here.

Free Code Camp progress 6/6/2020

Applied Accessibility component of Responsive Web Design with Free Code Camp is now complete.

accessibility

#freecodecamp,#applied,#accessibility,#learning,#skills, #responsive,#web,#design,#codeclub

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

I can be contacted on Mastodon here.

Free Code Camp progress 4/6/2020

I have spent the last few days, working though Applied Accessibility, which is the forth component of Responsive Web Design.

accessibility

I needed to ask for some help on the date/time activity. I therefore wrote this post while waiting. In true fashion, within about an hour I had an answer from the FreeCodeCamp forum. Turns out I had an errant space and period in my code.

I am roughly 50% of the way through so making good progress.

#freecodecamp,#applied,#accessibility,#learning,#skills, #responsive,#web,#design,#codeclub

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

I can be contacted on Mastodon here. You can get a free account on the http://qoto.org instance by following this link.

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

Get a free Repl.it online IDE account here Get an Overleaf account here, Online collaborative LaTeX Editor

Free Code Camp – Visual Design 7

Now fully completed Applied Visual Design module with FreeCodeCamp so have now reached 100% of the way through the module

visual design 7

On onto Applied Accessibility next

#learn, #freecodecamp, #web, #responsive,#visual #design, #html, #css, #skills, #codeclub,

Happy to provide help and support via decentralised social media. I can be contacted on Mastodon here. You can get a free account on the http://qoto.org instance by following this link.

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

Free Code Camp – Visual Design 6

Completed more of the Applied visual design module with FreeCodeCamp so now reached 73% of the way through the module

visual design 5

More tomorrow.

#learn, #freecodecamp, #web, #responsive,#visual #design, #html, #css, #skills, #codeclub,

Happy to provide help and support via decentralised social media. I can be contacted on Mastodon here. You can get a free account on the http://qoto.org instance by following this link.

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

Free Code Camp – Visual Design 5

Completed 10% more of the Applied visual design module with FreeCodeCamp so now reached 60% of the way through the module

visual design 5

#learn, #freecodecamp, #web, #responsive,#visual #design, #html, #css, #skills, #codeclub,

Happy to provide help and support via decentralised social media. I can be contacted on Mastodon here. You can get a free account on the http://qoto.org instance by following this link.

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

Free Code Camp – Visual Design 4

Completed some more of the visual design module in FreeCodeCamp so now reached 50% of the way through the module

visual design 4

So lots of progress made on this, and more useful skills being developed.

#learn, #freecodecamp, #web, #responsive,#visual #design, #html, #css, #skills, #codeclub,

Happy to provide help and support via decentralised social media. I can be contacted on Mastodon here. You can get a free account on the http://qoto.org instance by following this link.

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)

Add more functions

I have added a few more maths functions to the application and also provided a clear function. There are still a few items to add to help improve debugging but the application is starting to take shape.

Notes

window = Tk()
window.title('Maths Application')
window.geometry("570x150") # w x h
window.resizable(0,0)
  1. The above code is being modified as I go. So I am changing the window size depending on what is being displayed.

  2. I have also made the Window title reflect the purpose of the application.

  3. That the source code now has 'result' as a label rather than output. This will show up future screenshots.

addition app

The code for the above is as follows.

#!/usr/bin/env python
import Tkinter # note use of caps
from Tkinter import *

window = Tk()
window.title('Maths Application')
window.geometry("570x150") # w x h
window.resizable(0,0)

#define button actions
def btn1():
	#convert box text in to integers	
	ent1 = int(entrytext.get())
	ent2 = int(entrytext2.get())
	
	#add the 2 integers and store in variable add
	add = (ent1 + ent2)
	print (add)
	
	#insert value of variable add in	to box outtext 
	outtext1.insert(0,str(add)) # insert response

def btn2():
	#print("subtraction")
	ent1 = int(entrytext.get())
	ent2 = int(entrytext2.get())
	
	#subtract the 2 integers and store in variable sub
	sub = (ent1 - ent2)
	
	
	#insert value of variable sub in	to box outtext 
	outtext1.insert(0,str(sub)) # insert response	
	
def btn3():
	#print("multiply")
	ent1 = int(entrytext.get())
	ent2 = int(entrytext2.get())
	
	#multiply the 2 integers and store in variable mul
	mul = (ent1 * ent2)
		
	#insert value of variable mul in	to box outtext 
	outtext1.insert(0,str(mul)) # insert response		

def btn4():
	#print("divide")
	ent1 = int(entrytext.get())
	ent2 = int(entrytext2.get())
	
	#multiply the 2 integers and store in variable div
	div = (ent1 / ent2)
		
	#insert value of variable mul in	to box outtext 
	outtext1.insert(0,str(div)) # insert response	
	
#clear boxes
def clear():
	#print("clear boxes") # leave in for legacy testing
	entrytext.delete(0, END) # clear input box
	entrytext2.delete(0, END) # clear input box2
	outtext1.delete(0, END) # clear output box
	
btn_tog2 = Button( window, text ='+', command=btn1) # add
btn_tog3 = Button( window, text ='-', command=btn2)  # subtract
btn_tog4 = Button( window, text ='x', command=btn3) #multiply
btn_tog5 = Button( window, text ='/', command=btn4) #divide
btn_tog6 = Button( window, text ='Clear', command=clear) #clear
btn_exit = Button( window, text ='Exit',command=exit)	 #exit

# define some labels
box1 = Label(window, text="1st Value")
box2 = Label(window, text="2nd Value")
box3 = Label(window, text="Result")

#define entry box 
entry1 = StringVar() # this is our entry box
entry2 = StringVar()
entrytext = Entry(window, textvariable=entry1) # this is our entry box
entrytext2 = Entry(window, textvariable=entry2) # this is our second entry box

#define out box 

entry2 = StringVar() # this is our output box
outtext1 = Entry(window, textvariable=entry2) # this is our output box

#display boxes
entrytext.grid(row = 3, column = 2,)  #display entry box
entrytext2.grid(row = 3, column = 3,)  #display entry box
outtext1.grid(row = 3, column = 4,) #display output box

#place labels
box1.grid(row = 1	, column = 2, padx = 5, pady = 5)
box2.grid(row = 1	, column = 3, padx = 5, pady = 5)
box3.grid(row = 1	, column = 4, padx = 5, pady = 5)

#buttons
btn_tog2.grid(row = 4, column = 2, padx = 1, pady = 1) # addition button
btn_tog3.grid(row = 4, column = 3, padx = 1, pady = 1) # subtraction button
btn_tog4.grid(row = 5, column = 2, padx = 1, pady = 1) # multiply button
btn_tog5.grid(row = 5, column = 3, padx = 1, pady = 1) # divide button
btn_tog6.grid(row = 4, column = 6, padx = 1, pady = 1) # clear button
btn_exit.grid(row = 3, column = 6, padx = 1, pady = 1) # exit button

window.mainloop()


The code that I used for a previous application to detect if numerical values have been used is below but provided 'as is' for now.

def response():
		
	msg = "error : must be a text value"

	i = circletext.get()
	y = i.isdigit()
	l = len(circletext.get())
	#print l
	if y == True or l == 0:
		circletext.insert(0,(msg))
		
	else:	
		x = random.choice(RESPONSES)
		circletext2.delete(0, END) # clear prev output
		circletext2.insert(0,str(x)) # insert response

I will integrate a version of this in to the main code.

#python, #tkinter, #programming, #python, #graphic, #applications, #bugs, #troubleshooting, #howto, #paignton, #library, #virtual, #codeclub

Happy to provide help and support via decentralised social media. I can be contacted on Mastodon here. You can get a free account on the http://qoto.org instance by following this link.

cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)