In this session, we will concentrate on very basic functionality in using Python as to allow you to read and modify some of the example scripts provided the Python tutorial underlying the course. We will have a look at some basic commands in Python, how to write and open Python scripts from the command line, flow control in scripts, and the definition and loading of functions.
The examples given in the session will largely follow those given in two excellent introductory tutorials.
- Swaroop Chitlur: A Byte of Python.
- Al Sweigart (2015): Automate the Boring Stuff with Python: Practical Programming for Total Beginners. No Starch Press.
For a more comprehensive introduction, make sure to check out The Quick Python Book by Naomi Ceder:
- Naomi Ceder (2018) The Quick Python Book. 3rd ed. Manning Publications.
We will have only time to discuss a small selection of content covered in these tutorials but make sure to spend some time after the course working through these tutorials. This will help you massively in becoming more self-proficient in the use of Python and ultimately allow you much more flexibility in collecting and analyzing digital trace data.
Another option for teaching yourself the basics of Python is a free interactive introductory course to Python offered by codecademy.
As you have probably gathered by now, this session will only offer you the most preliminary of introductions to the use of Python. But do not worry. If you caught the bug, there are excellent guides available to you taking you further down the rabbit hole.
For a broader view of collecting digital trace data beyond Twitter see:
For a very helpful introduction to data analysis with Python see:
- Wes McKinney (2017) Python for Data Analysis 2nd ed. O’Reilly Media, Inc.
For a handy introduction to machine learning with Python see:
Remember, you might have online access to O’Reilly and PACKT books through your university’s library.