Skip to content

Commit bff37af

Browse files
committed
Adding python script to generate student names and the file of those names.
1 parent 2eb5027 commit bff37af

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
studentNames = list()
2+
fr = open('C:\Users\Josh\PYTHON100\courseenrollees 9-30-13 - Sheet1.csv')
3+
lines = fr.readlines()
4+
fr.close()
5+
#print(type(lines))
6+
#print(len(lines))
7+
for line in lines:
8+
segments = line.split(',')
9+
studentNames.append(segments[0] + ", " + segments[1])
10+
# Python is smart enough to not keep on appending to this file when run multiple times
11+
fw = open('C:\Users\Josh\PYTHON100\IntroToPython\week-01\students.txt', 'w')
12+
for name in studentNames:
13+
fw.write(str(name) + '\n')
14+
fw.close()

week-01/students.txt

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
1-
Students in the 2013 Python Cert Class
2-
3-
Name:
4-
Programming Background:
5-
6-
Languages:
7-
1+
lastName, firstName
2+
Antoun, Jo-Anne
3+
AuBuchon, Harlan
4+
Bae, Andrew
5+
Chan, Lawrence
6+
Chhen, Rithy
7+
Colwell, Kimberly
8+
Cypret, Luke
9+
Eaton, Sako
10+
Edson, Howard
11+
Flagg, Nate
12+
Gapasin, Anne-Lynn
13+
Grizzel, Travis
14+
Ivers, Brandon
15+
Kang, Dong
16+
Leblanc, Adam
17+
Onen, Omer
18+
Parrish, Brent
19+
Pei, Guangyu
20+
Petrova, Maria
21+
Popish, Mario
22+
Rajagopalan, Sridharan
23+
Salkodu Parameshwar, Maitri
24+
Savage, Nathan
25+
Schmitz, Brian
26+
Small, Edward
27+
Smith, Richard
28+
Thach, Phuc
29+
Tran, Linh
30+
Warren, Catherine
31+
Werner, Steven
32+
Wright, Duane

0 commit comments

Comments
 (0)