TECHS5: Programming for Technical Communicators

The TECHS5 Programming for Technical Communicators course is an introductory programming course for technical writers. The course is aimed to give you an overview of the basic concepts of programming and teach you the basic skills you need to create your own scripts and programs later on. In addition to learning how to write simple programs that make your life easier, you’ll learn to recognize situations where a well-though-of script or program could save you a lot of manual work.

During the course, we’ll use the Python programming language and Notepad++ as our go-to tools. Python was selected mainly because the syntax of the language is fairly clear and, as an interpreted language, writing and testing your own scripts is nice, easy and fast. And Python’s fun, too. And there’s a world of Monty Python puns.

TECHS5 – Luento 7

Viimeisellä luennolla tutustutaan mitä oliot ovat ja kuinka niitä luodaan ja muokataan. Tämän lisäksi tutkaillaan kuinka olioihin tallennetusta tiedosta saa tuotettua sisältöä verkkosivulle, ja kuinka tuota tietoa voi halutessaan muokata.

TECHS5 – Luento 6

Kuutosluennolla lueskellaan taulukoita for-silmukoiden avulla, tutustutaan sisäkkäisiin for-silmukoihin ja kokeillaan kuinka helppoa päättymättömän silmukan tekeminen on while-silmukkarakenteella.

TECHS5 – Luento 5

Viidennellä luennolla tutustutaan tiedon säilömiseen taulukoihin sekä taulukoiden käsittelyyn sisäänrakennettujen metodien avulla.

TECHS5 – Luento 4

Neljännellä luennolla vietetään laatuaikaa funktioiden parissa. Perehdymme parametrien käyttämiseen omien funktioden kanssa ja opimme kuinka funktiosta voi palauttaa tietoa takaisin ohjelmiin paluuarvojen avulla. Jos aikaa riittää, tutustumme myös taulukoihin.

TECHS5 – Luento 3

Kolmosluennolla tarkastellaan loogisia operaattoreita ja tutustutaan if-else if-else -lauseisiin. Näiden lisäksi katsotaan if-else – muistuttavaa switch-lausetta ja – jos aikataulu sallii – laaditaan omia funktioita.

TECHS5 – Luento 2

Toisella luennolla jatketaan JavaScriptin perusteiden parissa. Luento alkaa katsauksella muuttujiin, jonka jälkeen tarkastelemme mm. ehtolauseita, syötteitä ja loogisia operaattoreita.

TECHS5 – Luento 1

Ensimmäisellä luennolla tutustutaan JavaScriptin perusteisiin ja tutkaillaan kuinka ohjelmia voi laatia Visual Studio Coden tai Stackblitzin avustuksella.

TECHS5 – Luento 7

Viimeisellä luennolla tutustutaan funktioiden paluuarvoihin, tiedostojen siirtämiseen ja kopiointiin sekä pakattujen tiedostojen käsittelyyn.

Luento Tehtävätiedostot Aiempien tehtävien ratkaisuja Lopputyömateriaalit

TECHS5 – Luento 6

Kuutosluennolla jatkamme tiedostojen lukemista Pythonin avulla sekä tutustumme omien funktioiden laatimiseen ja käyttämiseen.

Luento Tehtävätiedostot Aiempien tehtävien ratkaisuja

TECHS5 – Luento 5

Viitosluennolla tutustutaan for-silmukoihin ja harjoitellaan tiedostojen lukemista ja kirjoittamista silmukoiden avulla.

Luento Tehtävätiedostot Aiempien tehtävien ratkaisuja

TECHS5 – Luento 4

Nelosluennolla tutustutaan pythonin while- ja for-silmukoihin ja tarkastellaan mitä kaikkea silmukoiden avulla voi tehdä.

Luento 4 Aiempien tehtävien ratkaisuja

TECHS5 – Luento 3

Kolmosluennon aluksi tutustumme Pythonin loogisiin operaattoreihin. Tämän jälkeen tarkastelemme Pythonissa käytettäviä tietorakenteita ja niiden käyttöä. Lopuksi – jos aikataulu sallii – tutkailemme kuinka Pythonin while-silmukka toimii.

Luento 3 Aiempien tehtävien ratkaisuja

TECHS5 – Luento 2

Kakkosluennolla tutustutaan tapoihin, joilla tekstiä ja muita sarjamuotoisia tietoja voi tarkastella ja muokata Pythonin avulla. Sen lisäksi tutustumme totuusarvoihin ja ehtolauseiden käyttöön.

Luento Aiempien tehtävien ratkaisuja

TECHS5 – Luento 1

Ensimmäisellä luennolla aloitamme tutustumisen ohjelmointiin Python-ohjelmointikielen avulla ja käymme läpi mitä kaikkea kurssin aikana on luvassa:

  • Muuttujat
  • Numeroiden käsittely
  • Tekstin käsittely
  • Ohjausrakenteet
  • Tietorakenteet
  • Silmukat
  • Funktiot
  • Tiedostojen käsittely

Esittelyosion jälkeen hyppäämme suoraan asiaan ja laadimme ensimmäiset, lyhyet ohjelmat Python-komentotulkin ja IDLE-kehitysympäristön avulla.

Luento 1

TECHS5: Lecture 7

During the final lecture, we’ll look at handling XML files with Python and how Python can be used to copy and move files.

Lecture Assignment Materials Exercise Files Cheatsheet

TECHS5: Lecture 6

During lecture 6, we’ll take a look at how we can create our own functions in Python. We’ll learn how we can use functions and their return values to clean the structure of our scripts. We will also have a look at Python’s ElementTree module and see how we can use it to read XML files.

Lecture View Gist Exercise files

TECHS5: Lecture 5

This time around, we’ll look at how to open, read and examine files. Then, we’ll look at how we can build our own functions and use them to clean up the structure of our programs.

Lecture View Gist Exercise files

TECHS5: Lecture 4

During this lecture, we’ll get acquainted with the while loop and look into ways we can harness its amazing powers to repeat stuff lots and lots of times. Next, we’ll move on to for loops and supercharge our iterable-handling powers.

Lecture View Gist

TECHS5: Lecture 3

The third lecture starts with a quick recap of what we learned last week. Then, we will take a look at the different data structures – lists, tuples and dictionaries – we have at our disposal, and start figuring out how and why we should use them. Once we’ve mastered them all, we’ll move on to loops, starting with the while loop.

If time permits, which it probably won’t, we’ll also have a look at for loops.

Lecture

TECHS5: Lecture 2

The second lecture starts with a quick recap of what we learned last week. After that, we’ll look into different functions that we can use to work with strings and other sequences. Then, we’ll learn about Boolean data types and conditional statements and see how they can be used to control the flow of our programs. We’ll also have a look at the various logical operators we can use in conditional statements. Finally, if time permits, we’ll look at the different data structures – lists, tuples and dictionaries – we have at our disposal.

Lecture

TECHS5: Lecture 1

Lecture one starts from the very basics. First, we’ll take a look at why this course is on the curriculum (there’s a solid reason!) and have a brief look at all the fun things you’ll learn about during the course:

  • Variables
  • Playing with numbers
  • Working with text
  • Conditional statements
  • Data structures
  • Loops
  • Functions
  • File handling

After the introduction, we’ll jump straight into Python and get to know both the Python Shell and IDLE. We’ll then get acquainted with variables and start using them with numbers and do a (tiny) bit of math. Next, we’ll move onto text, or strings, and figure out how to print stuff, manipulate text and ask for user input in Python.

Download files:

Lecture Sidetrack Slides Sidetrack Exercises

Lecture 7: Working with functions and watching out for errors

During the final lecture, we’ll continue looking at functions. We’ll find out how we can return values from our own functions and look at cases where return values come in handy. If time permits, we’ll have a quick look at how Python lets us anticipate errors and deal with them in ways that won’t break our programs.

Lecture 6: Working with zip files and creating functions

This week, we’ll take a look at how you can use Python to work with zip files. We’ll also look at how you can define your own functions in Python and use them to clean up the structure of your programs. (more…)

Lecture 5: while loops, file operations and functions

During this lecture, we’ll look into while loops, learn more ways to manage files using Python, and get to know how we can create our own functions. (more…)

Lecture 4: Lists, for loops and modules

We’ll continue working with for loops and get to know a new information type, the list. In addition, we’ll have a look at modules and see how they can be used to bring in new features to your scripts.

Lecture 3: Sequences, Lists and Loops

The third lecture starts off with a look at sequences. We’ll find out what sequences are, how you can access elements in a sto, and how you can create sequences of your own. Next, we’ll take a look at the for loop and examine how you can harness its powers to repeat simple – and complex – tasks with ease. We’ll learn about lists, too, and see how they can be used to store information so that it is easily accessible and modifiable. If we have time, we’ll also take a look at how you can add more functionality into your programs easily with Python Modules.

Lecture 2: User input, conditional statements and loops

The second lecture starts with a quick recap of what we learned last week. After that, we’ll start looking at how to get input from the users into your program, and what to do with that input. After that we’ll move on to conditional statements and learn how we can direct our programs based on, for example, different input that we’ve received from the users. We’ll learn how we can combine different sets of conditions to fine-tune the program flow, and learn to hate missing colons and broken indentation while we do so. After conditional statements, we’ll move on to loop structures, starting with the while loop. While looking a loops, we’ll also have a quick look at what Python modules are and what we can do with them. Once we know everything there is to know about while loops, we’ll learn the horrible truth about strings (they’re actually sequences!). If there’s time, we’ll start working with the for loop, the most magical of all the loops in the world.

Surviving DOS

Here’s the basic set of commands you’ll need to survive the Windows Command Prompt.

Moving between directories

The cd (change directory) command is used to move from one directory to another:

cd <Target directory>

Move to a directory called Python34:

cd Python34

Move to the root directory of the current drive (Win):

cd \

Move to the root directory of this drive (Linux/OSX):

cd / Move up one directory.

For example, from c:\users\mika to c:\users:

cd ..

Move from the current directory – for example c:\Python34 – to the directory c:\users\mika:

cd \users\mika

To move from one drive to another, simply type the drive letter followed by a colon:

x:

(more…)

Lecture 1: Getting Started

Lecture one starts from the very basics. First, we’ll take a look at why this course is on the curriculum (there’s a solid reason!) and have a brief look at what you’ll learn – and what you probably won’t learn – during the course. We’ll also explore what you can expect from the course, if you already have some programming experience. (more…)