This document can be found online at https://github.com/chop-dbhi/backtoschool
Today we went over some Python basics, but there are a few other commands that might be very helpful:
- The
elif
statment - (https://docs.python.org/3/tutorial/controlflow.html#if-statements) This statement is used between anif
statement and andelse
statement to check for other possible conditions that might true. - The
or
operator - (http://openbookproject.net/thinkcs/python/english3e/conditionals.html#logical-operators) This operator can be used in the same place as theand
operator to change the logic of your conditions.
If you'd like to continue at home check out our releases page at https://github.com/chop-dbhi/backtoschool/releases for a copy of the python project you worked on today. You can also continue to play around with the webpage editor at http://chop-dbhi.github.io/backtoschool/. Take a look at the JavaScript tab to learn about writing code to modify webpages on the fly.
We hope you enjoyed our introduction to the world of programming. Our team uses a wide variety of tools to try and solve complex problems in healthcare. We're really excited to have the opportunity to show you a small slice of the toolkit we use to tackle these tough problems.
The best part about our job is the wide variety of tools and technologies that we get to use to solve these problems, their low barrier to entry and the positive impact it has on children's health. Whether you're crunching a huge set of numbers, manipulating imagery, or building a sleek new web application, it's amazing how easy it is to get started coding new solutions to tough problems -- no matter what those problems might be and no matter how much experience you might have trying to solve them.
Today we got started writing code and manipulating images in Python, we coded a web page with HTML, and styled it with CSS. We also included some additional JavaScript in our demo that we encourage you to explore after our workshop. JavaScript allows a coder to dynamically alter the content of a web page beyond what standard HTML might allow. Most of the websites you visit today make heavy use of JavaScript to create dynamic, interactive user interfaces. Take a look at the "JavaScript" tab in our demo for an example of that interactivity.
If this quick tutorial was at all interesting to you and you're looking to learn more, then good news! There are a ton of resources online for you to dig in and start learning more about programming.
Whether you'd like to build a new game, automate a repetitive task, create an amazing web page, or dive into an interesting set of data, there are a variety of tools and techniques that you can learn to build something awesome. Seriously, you can do it!
Check out the list below for some helpful resources that will help you on your journey to building the "Next Big Thing"!
- http://python.org - An easy to learn programming language with a ton of capabilities. We got to play with a bit of Python code today. Checkout our the https://github.com/chop-dbhi/backtoschool/releases section of our github repository to download a version of the Python GUI we used today on your own computer.
- http://ipython.org/ - This is the tool we used today to write Python code in the web browser. Try it online at https://try.jupyter.org/.
- https://developer.mozilla.org/ (HTML/Javascript/CSS) - Mozilla (the organization that created Firefox) has an excellent resource for all things Web related.
- https://git-scm.com - "Source code management" Keep track of the changes you make to your code. Make it easy to share your code and collaborate with other programmers. Check out the http://try.github.com/ link to jump right in!
- https:/github.com - A website that makes it easy to share git repositories. Check github for a wealth of example code from a wide variety of organizations (CHOP, Google, Facebook, Microsoft, etc.)
- https://www.khanacademy.org/ - (Free) Try the "Hour of Code" under computing!
- http://code.org/ - (Free) Great web based "studio"
- http://edX.org - (Free) Learn fundamental Computer Science principles
- http://coursera.org - (Mostly free)
- http://www.codeacademy.com - (Mostly Free)
So many applications that we use every day now live on the web. The web provides a fantastic platform for developing tools whether you are using a mac, pc, or mobile device. Many of these applications utilize a wide variety of technologies. Usually these technologies are broken into two categories "Backend" -- which is the server code that pushes web pages to the browser or "Frontend" which is client code that runs in your web browser. Generally, a language like Python is used to create "Backend" code, and HTML+CSS+JavaScript can be used to create "Frontend" applications. JavaScript is unique in that you can create both the server code (using a framework called https://nodejs.org) and the client code with one language.
At CHOP many of our applications "Backend" code is written using Python, and our "Frontend" code is a combination of HTML, CSS, and JavaScript. Take a look at our github page for examples of our work.
- http://djangoproject.com - Full featured web framework. This project is a good place to start. You'll find that working with django you'll touch on a lot of interesting technologies: HTML/CSS/JavaScript, web APIs, databases, etc.
- http://flask.pocoo.org - Like django but with not as many bells and whistles.
- http://getbootstrap.com - HTML + CSS + JavaScript framework used to quickly develop professional looking web pages.
- http://jquery.com - A JavaScript library with excellent documentation that simplifies
Most people enjoy playing games. Whether they're on a console, computer, your phone or your browser, sometimes it's nice to kick back and play. PyGame is a very accessible toolkit to create games in python. Many developers these days are writing web-based games (using HTML5, JavaScript, CSS, etc).
- http://pygame.org - A toolkit that makes creating games in python easy and fun.
- http://www.html5gamedevelopment.com/ - HTML game development
- http://www.html5quintus.com/ - An easy to learn and fun to use game engine.
- http://rpgjs.com/ - Create 2.5D Bitmap based "Zelda-like" games
People like to kick around terms like "big data" and "the cloud". What does big data really mean? Well, over the last few decades we've made incredible progress in collecting all sorts of data about different parts of the systems we build and interact with -- now what do we do with it? Finding interesting trends and information in huge datasets is something that the computer science world is really excited about. Part of working with these large data sets is storing or "persisting" the data in a database. Most applications you use have a persistence layer where data is stored and queried. The other half is processing the data. Python is good for writing quick scripts to manipulate data because it is dynamically typed. That means you don't have to think too much about the "data types" (i.e. string, integer, float, boolean) that your data contains -- you can just get to work on it! Pandas is a great python package that
- http://pandas.pydata.org/ Data analysis Package
- http://pydata.org/downloads/ A site with a collection of different analysis packages for Python (including Pandas)
- http://www.r-project.org - A free statistics package.
Crunching data can be fun and extremely useful, but sometimes information is best conveyed visually. Tons of work is being done to figure out how to effectively translate data analysis into visualization that people can quickly grasp at a glance. Data visualization is exciting because it combines the math and analysis of data crunching with the creativity of visualizations.
- http://datavisualization.ch/- A great site highlighting interesting approaches in data visualization.
- http://d3js.org/ - An amazing JavaScript data visualization library. This library has a high learning curve, but the visualizations it can create are truly amazing. Check out some the visualizations at http://www.pewresearch.org/fact-tank/2014/12/29/our-favorite-pew-research-center-data-visualizations-from-2014/ -- most of these are done with d3.
- http://ipython.org - This is the tool we used today to code in the browser. It is often used to create visualizations. You can use it to write code in your web browser. Try out the "Notebook" version of it here: https://try.jupyter.org/
Writing software that runs on the web or in the terminal is a lot of fun, but what if you could write software to automatically unlock doors, water your plants, or alert you when someone comes into a room? Well you can! The computers we've been using today are called Raspberry Pi's. These machines are relatively inexpensive, but they pack a lot of features into a tiny package. Combined with a microcontroller like the Arduino you can build projects that do any variety of things. These projects usually require a bit of electrical engineering (like soldering and circuit design) but there are tons of easy projects to get you started.
- https://www.raspberrypi.org/ - The mini computer you used today!
- https://www.arduino.cc/ - A collection of relatively inexpensive microcontrollers to build a huge variety of things.
- https://www.sparkfun.com/ - A great supplier of components to build your projects.
- http://www.instructables.com/tag/type-id/category-technology/ - A great set of projects of variable difficulty.