Category: Raspberry Pi
-
From Apple to Raspberry Pi: Transitioning into Functions.
When I started Making App Pie, one of my big frustrations was wrapping my head around defining methods. I was used to C++ and Java functions. Objective-C and its Smalltalk roots just threw me. Now going into Python is difficult too — but for another reason. Once again dynamic typing in Python rears up to…
-
From Apple to Raspberry Pi: While Loops
In Xcode, both in Objective-C and C, we have the while loop. The python equivalent is also while Since we already understand the block, know sometimes as a suite in Python, while loops in Python are very simple to use. We can use break in a loop to break execution. This is a valid loop…
-
Apple to Raspberry Pi: Python’s If
In Objective-C, we would write an if statement like this: if(number1 == number2){ NSLog(@”equal”); } in Python it is this: if number1==number2 : print(‘equal’) There is no parentheses required around the logical expression. Instead of the {} to show the block to run, a colon (:) and indentations find the code to run. Note that…
-
From Apple to Raspberry Pi: Variables and Types
I’m trying to learn Python for my new Raspberry Pi — though with all the app development I do that is not so easy. I need to wrap my head around some very different concepts. The first concept that is obvious is the dynamic typing of Python. If you’ve used Objective-C or C, those are…
-
Going from Apple to Raspberry Pi
I got a new toy this week at work: A Raspberry Pi. It’s a small computer the size of a mint tin that costs about $35. I comes just as a board, but I invested in a nice case for it. Instead of a hard drive you use a SD card for storage of the…