Schedule

Schedule

Thursday, May 28

1432827000 Tech News Today
1432830600 TWiT Live Specials
1432839600 Know How...
1432846800 Home Theater Geeks
1432854000 Tech News 2Night

Friday, May 29

1432918800 Tech News Today
1432922400 This Week in Law
1432933200 Before You Buy
1432940400 Tech News 2Night

Saturday, May 30

1433008800 The Tech Guy

Sunday, May 31

1433095200 The Tech Guy
1433109600 This Week in Tech

Monday, June 1

1433178000 Tech News Today
1433181600 Triangulation
1433187000 iOS Today
1433194200 Coding 101
1433199600 Tech News 2Night

Tuesday, June 2

1433264400 Tech News Today
1433268000 MacBreak Weekly
1433277000 Security Now
1433286000 Tech News 2Night
1433289600 All About Android

Wednesday, June 3

1433345400 FLOSS Weekly
1433350800 Tech News Today
1433354400 Windows Weekly
1433361600 This Week in Google
1433372400 Tech News 2Night
1433374200 Android App Arena
1433379600 Ham Nation

Thursday, June 4

1433437200 Tech News Today
1433440800 Know How...
1433451600 Home Theater Geeks
1433458800 Tech News 2Night

Friday, June 5

1433523600 Tech News Today
1433527200 This Week in Law
1433538000 Before You Buy
1433545200 Tech News 2Night

Saturday, June 6

1433613600 The Tech Guy

Most Recent Episodes

Ham Nation

Bob Heil visits the ultimate builder.

iFive for the iPhone

Is the Apple Watch vulnerable to theft?

This Week in Google

Google Tracker (I/O edition), Android M, Chromecast 2, and lots more.

Android App Arena

GTasks, Wunderlist, Any.do, Layout.

Windows Weekly

Cortana on iOS and Android, and Salesforce turns down $55 billion from MS.

Tech News 2Night

NPR's Elise Hu joins us to talk about Japan's Start-up scene.

FLOSS Weekly
Episode #338: Lucee May 27th, 2015

Andrew Dixon, Gert Franz, and Lucee: a dynamic scripting language for the JVM.

Tech News Today

iPhones crash and reboot when a specific string of text is received.

All About Android

Google IO predictions, Periscope for Android, and a a packed round table session.

Security Now
Episode #509: TLS Logjam May 26th, 2015

Routers with a USB port could be vulnerable to attack because of a NetUSB bug.

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