Class 21: File parsing lab

May 15, 2020

Downloads

Session log

Luis Perez
2020-05-15 09:00:34
**Class started**
Luis Perez
2020-05-15 09:07:42
Inserting a line in an existing file
f = open("path_to_file", "r")
contents = f.readlines()
f.close()

contents.insert(index, value)

f = open("path_to_file", "w")
contents = "".join(contents)
f.write(contents)
f.close()
Luis Perez
2020-05-15 09:14:56
**Entering breakout rooms**
Luis Perez
2020-05-15 09:15:55
Share one new thing you learned from the 03_molecular-structure notebook? (Reply in thread.)
Luis Perez
2020-05-15 09:16:01
What should we discuss in the main session from the 03_molecular-structure notebook? (Reply in thread).

Hannah Markovic
2020-05-15 10:48:25
Can you give an example of a valid input for the calc_hn function? I keep getting errors
Polly Poll
2020-05-15 09:16:11
Poll by @Luis Perez
I would rate my understanding of the material in the 03_molecular-structure notebook as:
😱⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ 0
🙁⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ 0
😐⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ 0
🙂█████████████████████████25
😄⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ ⁢ 0
Luis Perez
2020-05-15 09:16:22
Help! We need a TA! (reply in thread if you need a TA)

Laura Taggart-Murphy
2020-05-15 10:28:50
Can we please get a TA in Breakout room 11?
Mike Harms
2020-05-15 09:20:26
Check out the ‘Format string syntax’ section: https://docs.python.org/3.8/library/string.html

Luis Perez
2020-05-15 09:23:50
get_valueis my favorite way to call stuff from dictionaries
Mike Harms
2020-05-15 10:50:38
Center of mass equation:

Mike Harms
2020-05-15 10:50:56
“M” is the sum of all of the masses