Schedule

Schedule

Thursday, August 21

1408653000 Coding 101
1408656600 Home Theater Geeks
1408662000 Tech News 2Night
1408663800 The Giz Wiz
1408672800 OMGcraft

Friday, August 22

1408726800 Tech News Today
1408730400 This Week in Law
1408737600 Android App Arena
1408748400 Tech News 2Night

Saturday, August 23

1408816800 The Tech Guy

Sunday, August 24

1408903200 The Tech Guy
1408917600 This Week in Tech

Monday, August 25

1408986000 Tech News Today
1408989600 Triangulation
1408995000 iPad Today
1409007600 Tech News 2Night
1409009400 Marketing Mavericks

Tuesday, August 26

1409072400 Tech News Today
1409076000 MacBreak Weekly
1409083200 Security Now
1409090400 Before You Buy
1409094000 Tech News 2Night
1409097600 All About Android
1409106600 Padre's Corner

Wednesday, August 27

1409153400 FLOSS Weekly
1409158800 Tech News Today
1409162400 Windows Weekly
1409169600 This Week in Google
1409180400 Tech News 2Night
1409182200 redditUP
1409187600 Ham Nation

Thursday, August 28

1409245200 Tech News Today
1409248800 Know How...
1409252400 The Social Hour
1409257800 Coding 101
1409261400 Home Theater Geeks
1409266800 Tech News 2Night
1409268600 The Giz Wiz
1409277600 OMGcraft

Friday, August 29

1409331600 Tech News Today
1409335200 This Week in Law
1409342400 Android App Arena
1409353200 Tech News 2Night

Saturday, August 30

1409421600 The Tech Guy

Most Recent Episodes

OMGcraft

Minecraft puzzle game.

Tech News Today

Hewlett-Packard yesterday surprised Wall Street by posting an unexpected increase in revenue.

Ham Nation

Bob Heil shows how to build an audio impedance matching box.

redditUP

IE dev team AMA, birdmen vs mudmen.

This Week in Google

How do you solve the problem of internet trolls?

Windows Weekly

HTC One Windows Phone and Windows 9 Release Preview

Tech News 2Night

Vine lets you import video.

FLOSS Weekly
Episode #305: Crate Data August 20th, 2014

Crate Data is a distributed SQL data store that runs on one machine or a cluster of machines.

Tech News Today

The data theft of some 4.5 million patients of Community Health Systems is thanks to Heartbleed.

Padre's Corner

Solar Cooking Birds and Brian Chee

Coding 101 16

Python - The External Data Circle of Life

May 8 2014

Hosts: Fr. Robert Ballecer, SJ and Shannon Morse

Guest: Dale Chase

Welcome to Coding 101 - It's the TWiT show that gives YOU the knowledge to live in the wonderful world of the programmer. This week we are introducing our newest module, Python with Code Warrior Dale Chase!

To see all the code used in today's episode, go to Our Github Repository for Module 2

Ivory Tower: External File IO

Using external data reqires knowledge of four functions: "open()", "
read()", "write()" and "close()"

open()
This function opens a file with the flags and mode of your choosing. For simplicity, we're only using the "r" "w" modes.
-- The "r" mode opens a file for "read only" use
-- The "w" mode blanks the file prepares to write to the file
* Note that this function DOES NOT READ THE FILE INTO A VARIABLE.

USAGE:
text_file = open("/Users/PadreSJ/Desktop/C101-16/write.txt", "r")
# This opens a file called "write.txt" in READ-ONLY mode and sets the pointer in variable "text_file"

text_file = open("/Users/PadreSJ/Desktop/C101-16/write.txt", "w")
# This opens a file called "write.txt" in WRITE MODE, sets the pointer in variable "text_file" and blanks that file.

read()
This function reads the contents of the file into a string variable.

USAGE:
textFromFile = text_file.read()
#This reads the file at pointer "text_file" into the string variable "textFromFile"

write()
This function writes a string into an external file.

USAGE:
text_file.write(MyString)
#This writes the contents of the string variable "MyString" into the file indexed at "text_file"

close()
This function closes access to the file.

USAGE:
text_file.close()

#This closes the file indexed at "text_file"

Get in Touch With Us!

* Subscribe and get Coding 101 automatically at TWiT.tv!
* Follow PadreSJ and Snubs on Twitter.
* Watch the show live and join the chatroom every Thursday at 1:30pm PST.
* Email us at Padre@twit.tv and Shannon@twit.tv.
* Join our Google+ Community!

Download or subscribe to this show at twit.tv/code. Also, check out our transcripts.

Bandwidth for Coding 101 is provided by Cachefly.

Running time: 49:50